3.3.6 Battleships Move Codehs -
Here’s a content guide to help you understand and complete the exercise on CodeHS.
function moveShip(e) MOVE_STEP = 15 def on_key_press(key): global ship_x if key == "left": ship_x -= MOVE_STEP elif key == "right": ship_x += MOVE_STEP 3.3.6 battleships move codehs
// Add keyboard listener onKeyDown(moveShip); Here’s a content guide to help you understand