The Student Room Group

Silver Idea Badge - Maker Part 2

Scroll to see replies

Reply 20

Original post
by safaxx
Basically, Iḿ stuck on the second part, the code is like this
var rooms = [bridge,lab,canteen,cabin,storage]

initiate();

function lifeSupportCheck() {
for (i=0;i<rooms.length;i++) {
rooms;
}
}

lifeSupportCheck();

Is this all on one line

Reply 21

Original post
by Luacbo25
Is this all on one line

no just copy and paste it but its incorrect if you get the answer can u copy and paste it I begg

Reply 22

(edited 1 year ago)

Reply 23

Original post
by Martyna75
iDEA - The Digital Adventurer Part Two and 1 more page - Personal - Microsoft&#8203; Edge 09_07_.png
Does anyone know how to do this?
You have to write a loop and inside the loop you must call the playSound() function and pass the soundBlock object into it
Edit: I got the answer here it is for anyone else who needs it:
var soundBlocks = [crash,happyBeep,whistle];
for (i=0;i<soundBlocks.length;i++)
{
playSound(soundBlocks);
}

it should be playSound(soundBlocks)

Reply 24

Heyy!!
I know this is late but this one defo works for any future people struggling: ( i was at this for 1 week 😭)

for (i = 0; i < soundBlocks.length; i++) { playSound(soundBlocks); }

Quick Reply