The Student Room Group

iDEA silver award Robotics

Having trouble with the idea maker 2 badge on the sound blocks, so far I have done this:

var soundblocks=[crash,happyBeep,whistle];
for(I=0;<soundBlocks.length;i++){
playsound(soundblocks);
}

it says to
"Loop through soundBlocks
call the playSound() function
Pass the correct sound from your sound array into it"
its case sensitive and your (I) needs to be lower caseJavaScript is always case sensitive so I'd check that if I were you 😃👍
Original post by hollyc0389
its case sensitive and your (I) needs to be lower caseJavaScript is always case sensitive so I'd check that if I were you 😃👍

Can you help me please? I've been stuck on this for 3 days and I can't get it to work
Attachment not found
Original post by Hannah_VMT
Can you help me please? I've been stuck on this for 3 days and I can't get it to work
Attachment not found

I managed to complete it, it took me a while
var soundBlocks = [crash,happyBeep,whistle];
for (i=0;i<soundBlocks.length;i++)
{
playSound(soundBlocks);
}

thats the correct answer, if when you have done you get to web design idea maker badge 3 and do it please let me know and give me a hand?
Original post by hollyc0389
I managed to complete it, it took me a while
var soundBlocks = [crash,happyBeep,whistle];
for (i=0;i<soundBlocks.length;i++)
{
playSound(soundBlocks);
}

thats the correct answer, if when you have done you get to web design idea maker badge 3 and do it please let me know and give me a hand?

thank you
It doesn’t work for me!
I am stuck on debugging the code for movement pls someone help
Original post by hollyc0389
I managed to complete it, it took me a while
var soundBlocks = [crash,happyBeep,whistle];
for (i=0;i<soundBlocks.length;i++)
{
playSound(soundBlocks);
}

thats the correct answer, if when you have done you get to web design idea maker badge 3 and do it please let me know and give me a hand?

so i tried to use this code and it didnt work so if possible can i recieve more help. this was my code:
var soundBlocks = [crash,happyBeep,whistle];
for (i=0;i<soundBlocks.length;i++){
playSound(soundBlocksi])
}
Reply 8
Original post by tian snipes
thank you

This is the correct answer
Reply 9
Original post by Fiona78
This is the correct answer

It might be but it isn't working when I typed in.
Reply 10
correct answer everyone:


var soundBlocks = [crash,happyBeep,whistle];
for (i=0;i<soundBlocks.length;i++) {
playSound(soundBlocks);
}

EVERYONE MISSES THIS OUT IN THEIR ANSWER ON HERE (bold)
Reply 11
Original post by Speedymr
correct answer everyone:
var soundBlocks = [crash,happyBeep,whistle];
for (i=0;i<soundBlocks.length;i++) {
playSound(soundBlocks);
}
EVERYONE MISSES THIS OUT IN THEIR ANSWER ON HERE (bold)

which bit is supposed to be bold
Original post by izzychap
so i tried to use this code and it didnt work so if possible can i recieve more help. this was my code:
var soundBlocks = [crash,happyBeep,whistle];
for (i=0;i<soundBlocks.length;i++){
playSound(soundBlocksi])
}

It doesn't work for me. I've been stuck for hours. Anyone help?
Reply 13
I finally work it out and I really passed that

var soundBlocks = [crash,happyBeep,whistle];
for (i=0;i<soundBlocks.length;i++) {
playSound(soundBlocks);
}
Reply 14
Original post by BiancaSoo
I finally work it out and I really passed that
var soundBlocks = [crash,happyBeep,whistle];
for (i=0;i<soundBlocks.length;i++) {
playSound(soundBlocks);
}

it doesn't work for me
var soundBlocks = [crash,happyBeep,whistle];
for (i=0;i<soundBlocks.length;i++)
{playSound(soundBlocks);}
Reply 16
Original post by Fiona78
This is the correct answer

var soundBlocks = [crash,happybeep,whistle];
for (i=0;i<soundBlocks.length;i++) {
playSound(soundBlocks[i]);}
(edited 4 months ago)
Reply 17
var soundBlocks = [crash,happybeep,whistle];
for (i=0;i<soundBlocks.length;i++)
{
playSound(soundBlocks "[i]" );
}

You guys are forgetting the "" part of the code.
Take away the quote marks from the i when putting it in
(edited 1 month ago)
Original post by izzychap
so i tried to use this code and it didnt work so if possible can i recieve more help. this was my code:
var soundBlocks = [crash,happyBeep,whistle];
for (i=0;i<soundBlocks.length;i++){
playSound(soundBlocksi])
}

thanks so much this really helped been strugling for hours

Quick Reply