Benoît Allard avatar Benoît Allard committed cbdb8f1

Finish the hard levels, add min register count

Comments (0)

Files changed (25)

levels/0-tutorials/0-cargo101.txt

 0 ; init pos of crane 
 2 ; num of stacks
+3 ; min necessary registers
 - ; toolbox
 <V>1234
 

levels/0-tutorials/1-transporter.txt

 0
 4
+4
 -
 <V>1234
 

levels/0-tutorials/2-re-curses.txt

 0
 2
+5
 -
 <V>1234
 

levels/0-tutorials/3-inverter.txt

 0
 6
+10
 -
 >V<1234
 

levels/0-tutorials/4-from-beneath.txt

 0
 3
+5
 -
 >V<1234
 by.#

levels/0-tutorials/5-go-left.txt

 0
 4
+9
 -
 >V<1234
 

levels/1-easy/0-double-flip.txt

 0
 3
+5
 -
 >V<1234
 brgy.#

levels/1-easy/1-go-left-2.txt

 0
 4
+4
 -
 >V<1234
 brg.#

levels/1-easy/2-shuffle-sort.txt

 1
 3
+9
 -
 >V<1234
 

levels/1-easy/3-go-the-distance.txt

 0
 8
+4
 -
 >V<1234
 ry.#

levels/1-easy/4-color-sort.txt

 1
 3
+8
 -
 >V<1234
 rg.#

levels/1-easy/5-walking-piles.txt

 0
 7
+9
 -
 >V<1234
 b.

levels/2-medium/0-repeat-inverter.txt

 0
 6
+6
 -
 >V<1234
 brgy.#

levels/2-medium/1-double-sort.txt

 1
 4
+11
 -
 >V<1234
 by.#

levels/2-medium/2-mirror.txt

 0
 6
+6
 -
 >V<1234
 gy.#

levels/2-medium/3-lay-it-out.txt

 0
 6
+7
 -
 >V<1234
 g.

levels/2-medium/4-the-stacker.txt

 4
 8
+8
 -
 >V<1234
 y.

levels/2-medium/5-clarity.txt

 0
 5
+0 ; < 7
 -
 >V<1234
 rg.#

levels/3-hard/0-come-togther.txt

 0
 7
+7
 -
 >V<1234
 y.

levels/3-hard/1-come-together-2.txt

 0
 7
+8
 -
 >V<1234
 gy.#

levels/3-hard/2-up-the-greens.txt

 0
 8
+7
 -
 >V<1234
 bg.#

levels/3-hard/3-fill-the-blanks.txt

 0
 8
+11
 -
 >V<1234
 rg.#

levels/3-hard/4-count-the blues.txt

+0
+7
+9
+-
+>V<1234
+by.#
+-
+yb
+
+
+
+yb
+
+
+-
+
+bb
+
+y
+
+b
+y
+-

levels/3-hard/5-multi-sort.txt

+0
+8
+11
+-
+>V<1234
+by.#
+-
+
+by
+
+yyb
+ybyb
+by
+b
+
+-
+yyyyyy
+
+
+
+
+
+bbbbbb
+-
     docklen = int(lines[1])
     if docklen <= 0:
         raise ValueError('docklen not strictly positive: %d' % docklen)
-    # lines[2] should contains a '-' or such
-    toolbox = lines[3:4]
-    # line 4 should contains a '-' or such
-    init = lines[6:6+docklen]
-    # line 3 + docken + 1 should contains a '-' or such
-    goal = lines[6+docklen+1:6+docklen+1+docklen]
-    # line 3 + docklen + 1 + docklen + 1 should contains a '-' or such
-    raw_code = lines[6+docklen+1+docklen+1:]
+    minreg = int(lines[2])
+    if lines[3] != '-': raise SyntaxError
+    toolbox = lines[4:5]
+    if lines[5] != '-': raise SyntaxError
+    init = lines[7:7+docklen]
+    if lines[7+docklen+1] != '-': raise SyntaxError
+    goal = lines[7+docklen+1:7+docklen+1+docklen]
+    if lines[7+docklen+1+docklen+1] != '-': raise SyntaxError
+    raw_code = lines[7+docklen+1+docklen+1:]
     code = []
     if len(raw_code) > 0:
         code = [raw_code[0]]
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.