11. Filling out cases, code not accepted


Hello everyone! I'm having trouble getting this code to pass. When I run it, Mario moves up, down, right and left but the exercise won't pass :frowning:

Has anyone else encountered this? My code is included below.

$(document).ready(function() {
    $(document).keydown(function(key) {
        switch(parseInt(key.which,10)) {
			// Left arrow key pressed
			case 37:
				$('img').animate({left: "-=10px"}, 'fast');
			// Up Arrow Pressed
			case 38:
				// Put our code here
			// Right Arrow Pressed
			case 39:
				// Put our code here
			// Down Arrow Pressed
			case 40:
				// Put our code here


Your code looks fine and passes on my side,

Have you tried using another browser ?

What error are you getting ?


I've tried using both chrome and edge. Might give Firefox a bash now.

The error that I'm getting is "Oops, try again. Make sure to press 'left', 'up', 'right', or 'down' to make your character move!"

I am pressing the keys required, do I need to press them a certain amount of times to pass?


I'm not sure about the exact amount of times, I would say to be safe try five all ways !


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.