rapid-router icon indicating copy to clipboard operation
rapid-router copied to clipboard

A solution that is better/shorter than the model solution gets incorrect algorithm score

Open sebp999 opened this issue 5 years ago • 0 comments

Describe the bug If a user proposes a more concise algorithm than the current model solution, then the algorithm score will be wrong: for example, my solution has 10 blocks, the model solution has 15, my algorithm score is 5.

To Reproduce Steps to reproduce the behaviour:

  1. Running on local machine, in rapid-router/game/views/level_solutions.py, replace the line for Level 50 with "50": '<xml xmlns="http://www.w3.org/1999/xhtml"><block type="start" deletable="false" x="590" y="697"><next><block type="turn_left"><next><block type="controls_repeat"><field name="TIMES">2</field><statement name="DO"><block type="move_forwards"></block></statement><next><block type="controls_repeat"><field name="TIMES">2</field><statement name="DO"><block type="turn_right"></block></statement><next><block type="turn_left"><next><block type="move_forwards"><next><block type="controls_repeat_while"><value name="condition"><block type="traffic_light"><field name="CHOICE">RED</field></block></value><statement name="body"><block type="wait"></block></statement><next><block type="turn_left"><next><block type="turn_right"><next><block type="move_forwards"><next><block type="controls_repeat"><field name="TIMES">2</field><statement name="DO"><block type="move_forwards"><next><block type="turn_right"></block></next></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block><block type="controls_repeat" x="169" y="928"><field name="TIMES">10</field></block><block type="controls_repeat" x="169" y="928"><field name="TIMES">10</field></block><block type="controls_repeat" x="169" y="928"><field name="TIMES">10</field></block><block type="controls_repeat" x="169" y="928"><field name="TIMES">10</field></block></xml>',

  2. run ./run

  3. Play Level 50 and use this solution: Screenshot from 2020-09-25 15-02-54

  4. You get 5 for algorithm

Expected behaviour You should get 10 for algorithm

Screenshots If applicable, add screenshots to help explain your problem. Screenshot from 2020-09-25 15-02-38

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
  • Browser Firefox
  • Version [e.g. 22]

Additional context The xml above contains 16 blocks. The solution in the image is 11.

sebp999 avatar Sep 25 '20 14:09 sebp999