kaka.farm

Unnamed repository; edit this file 'description' to name the repository.
git clone https://kaka.farm/~git/kaka.farm
Log | Files | Refs | README

sokoban_tests.js (780B)


      1 console.log('tests start');
      2 
      3 console.log(sokoban);
      4 
      5 let game = sokoban.new_game();
      6 [
      7 	sokoban.action_step_right,
      8 	sokoban.action_step_right,
      9 	sokoban.action_step_right,
     10 	sokoban.action_step_right,
     11 	sokoban.action_step_right,
     12 	sokoban.action_step_right,
     13 	sokoban.action_step_right,
     14 	sokoban.action_step_right,
     15 	sokoban.action_next_level,
     16 ].forEach(action_function=>{
     17 	let s = sokoban.game_to_text(game);
     18 	console.log(`before:
     19 ${s}
     20 KAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKA`
     21 	);
     22 	action_function(game);
     23 	s = sokoban.game_to_text(game);
     24 	console.log(`after:
     25 ${s}
     26 KAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKA`
     27 	);
     28 })
     29 sokoban.action_next_level(game);
     30 let s = sokoban.game_to_text(game);
     31 console.log(`after: ${s}`)
     32 sokoban.action_next_level(game);
     33 s = sokoban.game_to_text(game);
     34 console.log(`after: ${s}`)