More challenge levels
This commit is contained in:
parent
05161a3c42
commit
6012831267
@ -139,13 +139,13 @@ moveBlock' world locMap visited loc loc' dir name box enters offset =
|
||||
do (n,b) <- Map.lookup loc' locMap
|
||||
(locI, offset') <- enterLoc world n b dir offset
|
||||
if Set.member locI enters then
|
||||
moveEpsilon
|
||||
do epsilon <- findEpsilon world (locName locI)
|
||||
moveEpsilon epsilon
|
||||
else
|
||||
moveBlock' world locMap visited loc locI dir name box (Set.insert locI enters) offset'
|
||||
|
||||
moveEpsilon =
|
||||
do epsilon <- findEpsilon world (locName loc')
|
||||
let eBox = boxIx world epsilon
|
||||
moveEpsilon epsilon =
|
||||
do let eBox = boxIx world epsilon
|
||||
(locI, offset') <- enterLoc world epsilon eBox dir offset
|
||||
moveBlock' world locMap visited loc locI dir name box (Set.insert locI enters) offset'
|
||||
|
||||
|
@ -62,6 +62,12 @@ parseBoring =
|
||||
"interesting" -> pure False
|
||||
_ -> empty
|
||||
|
||||
parseHeight :: ReadP (Maybe Int)
|
||||
parseHeight = option Nothing $
|
||||
do "height" <- token
|
||||
Just <$> integer
|
||||
|
||||
|
||||
parseBlock :: ReadP (Char, Box, [(Char, Location)])
|
||||
parseBlock =
|
||||
do cmd <- token
|
||||
@ -70,9 +76,10 @@ parseBlock =
|
||||
do [name] <- token
|
||||
color <- parseColor
|
||||
boring <- parseBoring
|
||||
height <- parseHeight
|
||||
skipMany (satisfy (' '==))
|
||||
_ <- char '\n'
|
||||
xs1 <- parseWalls
|
||||
xs1 <- parseWalls height
|
||||
let locs = findLocs name xs1
|
||||
let b = Box Nothing (Original (walls xs1)) color boring
|
||||
pure (name, b, locs)
|
||||
@ -92,18 +99,20 @@ parseBlock =
|
||||
do [name] <- token
|
||||
[target] <- token
|
||||
color <- parseColor
|
||||
height <- parseHeight
|
||||
skipMany (satisfy (' '==))
|
||||
_ <- char '\n'
|
||||
xs1 <- parseWalls
|
||||
xs1 <- parseWalls height
|
||||
let locs = findLocs name xs1
|
||||
let b = Box Nothing (Epsilon target (walls xs1)) color False
|
||||
pure (name, b, locs)
|
||||
_ -> empty
|
||||
|
||||
parseWalls :: ReadP [String]
|
||||
parseWalls =
|
||||
parseWalls :: Maybe Int -> ReadP [String]
|
||||
parseWalls height =
|
||||
do row0 <- munch1 ('\n' /=) <* char '\n'
|
||||
rows <- replicateM (length row0 - 1) (munch1 ('\n' /=) <* char '\n')
|
||||
let h = maybe (length row0 - 1) (subtract 1) height
|
||||
rows <- replicateM h (munch1 ('\n' /=) <* char '\n')
|
||||
pure (row0:rows)
|
||||
|
||||
token :: ReadP String
|
||||
|
27
levels/challenge08.txt
Normal file
27
levels/challenge08.txt
Normal file
@ -0,0 +1,27 @@
|
||||
player p height 81
|
||||
block b blue interesting
|
||||
▓▓▓▓▓▓▓▓▓
|
||||
▓ ▓
|
||||
▓ - - ▓
|
||||
▓ y g ▓
|
||||
▓ ▓
|
||||
▓ p b ▓
|
||||
▓ ▓
|
||||
▓ ▓
|
||||
▓▓▓▓▓▓▓▓▓
|
||||
block y yellow boring
|
||||
▓
|
||||
block g green interesting
|
||||
▓▓▓▓▓▓▓
|
||||
▓ ▓
|
||||
▓ ▓
|
||||
▓
|
||||
▓▓▓ ▓
|
||||
▓= - ▓
|
||||
▓▓▓▓▓▓▓
|
||||
block p red boring
|
||||
▓▓▓▓▓
|
||||
▓ ▓ ▓
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
87
levels/challenge18.txt
Normal file
87
levels/challenge18.txt
Normal file
@ -0,0 +1,87 @@
|
||||
player p height 154
|
||||
block w white boring
|
||||
▓▓▓▓▓▓▓▓▓▓▓
|
||||
▓abc▓ q▓▓▓▓
|
||||
▓ p ▓▓
|
||||
▓123▓▓▓▓y ▓
|
||||
▓▓▓▓▓▓▓▓▓ ▓
|
||||
▓▓▓▓▓▓▓I H▓
|
||||
▓▓▓4▓▓▓ ▓▓▓
|
||||
▓ ▓K J▓▓▓
|
||||
▓ ▓▓▓▓▓
|
||||
▓LMN▓ r▓▓▓▓
|
||||
▓▓▓▓▓▓▓▓▓▓▓
|
||||
block 1 green boring
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
||||
▓▓
|
||||
▓▓ ▓▓
|
||||
block 2 green boring
|
||||
▓▓▓▓▓
|
||||
▓▓
|
||||
▓▓ ▓▓
|
||||
▓▓
|
||||
▓▓▓▓▓
|
||||
block 3 green boring
|
||||
▓ ▓▓▓
|
||||
▓▓▓
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
||||
block 4 green boring
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
||||
▓=▓▓▓
|
||||
▓ ▓▓▓
|
||||
block A cyan boring
|
||||
▓
|
||||
block B cyan boring
|
||||
▓
|
||||
block C cyan boring
|
||||
▓
|
||||
block D cyan boring
|
||||
▓
|
||||
block E cyan boring
|
||||
▓
|
||||
block F cyan boring
|
||||
▓
|
||||
block G cyan boring
|
||||
▓
|
||||
block H cyan boring
|
||||
▓
|
||||
block I cyan boring
|
||||
▓
|
||||
block J cyan boring
|
||||
▓
|
||||
block K cyan boring
|
||||
▓
|
||||
block L cyan boring
|
||||
▓
|
||||
block M cyan boring
|
||||
▓
|
||||
block N cyan boring
|
||||
▓
|
||||
block p red boring height 1
|
||||
ABCDEFG
|
||||
link q p red
|
||||
link r p red
|
||||
block a blue boring
|
||||
▓▓▓
|
||||
▓▓▓
|
||||
▓ ▓
|
||||
block b blue boring
|
||||
▓▓▓
|
||||
▓▓▓
|
||||
▓ ▓
|
||||
block c blue boring
|
||||
▓▓▓
|
||||
▓▓▓
|
||||
▓ ▓
|
||||
block y yellow boring
|
||||
▓▓ ▓▓
|
||||
▓▓
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
43
levels/challenge30.txt
Normal file
43
levels/challenge30.txt
Normal file
@ -0,0 +1,43 @@
|
||||
player p height 81
|
||||
block w white boring
|
||||
▓▓▓▓▓▓▓▓▓
|
||||
▓▓▓ y▓▓▓▓
|
||||
▓ ▓▓
|
||||
▓ G ▓▓
|
||||
▓=p g▓
|
||||
▓ Y ▓▓
|
||||
▓ ▓▓
|
||||
▓▓E▓F▓▓▓▓
|
||||
▓▓▓▓▓▓▓▓▓
|
||||
link G g green
|
||||
link Y y yellow
|
||||
block p red boring
|
||||
▓▓▓▓▓
|
||||
▓ ▓ ▓
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
||||
block y yellow boring
|
||||
▓▓▓
|
||||
▓▓
|
||||
▓▓▓
|
||||
block g green boring
|
||||
▓▓▓
|
||||
▓▓
|
||||
▓▓▓
|
||||
epsilon E y yellow
|
||||
▓▓▓ ▓
|
||||
|
||||
|
||||
|
||||
1-
|
||||
epsilon F g green
|
||||
▓▓▓ ▓
|
||||
|
||||
|
||||
|
||||
2-
|
||||
block 1 cyan boring
|
||||
▓
|
||||
block 2 cyan boring
|
||||
▓
|
56
levels/challenge31.txt
Normal file
56
levels/challenge31.txt
Normal file
@ -0,0 +1,56 @@
|
||||
player p height 81
|
||||
block w white boring
|
||||
▓▓▓▓▓▓▓▓▓
|
||||
▓ ▓
|
||||
▓ g y ▓
|
||||
▓B G Y b▓
|
||||
▓ ▓
|
||||
▓ p ▓▓▓▓
|
||||
▓= ▓
|
||||
▓▓▓▓▓QRS▓
|
||||
▓▓▓▓▓▓▓▓▓
|
||||
link G g green
|
||||
link Y y yellow
|
||||
link B b blue
|
||||
block p red boring
|
||||
▓▓▓▓▓
|
||||
▓ ▓ ▓
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
||||
▓▓▓▓▓
|
||||
block y yellow interesting
|
||||
▓▓▓
|
||||
▓▓▓
|
||||
▓ ▓
|
||||
block g green interesting
|
||||
▓▓▓
|
||||
▓▓▓
|
||||
▓ ▓
|
||||
block b blue interesting
|
||||
▓▓▓
|
||||
▓▓▓
|
||||
▓ ▓
|
||||
epsilon Q g green
|
||||
▓▓▓ ▓
|
||||
▓-▓ ▓
|
||||
▓1 ▓
|
||||
▓ ▓▓▓
|
||||
▓ ▓▓
|
||||
epsilon R y yellow
|
||||
▓▓▓ ▓
|
||||
▓-▓ ▓
|
||||
▓2 ▓
|
||||
▓ ▓▓▓
|
||||
▓ ▓▓
|
||||
epsilon S b blue
|
||||
▓▓▓ ▓
|
||||
▓-▓ ▓
|
||||
▓3 ▓
|
||||
▓ ▓▓▓
|
||||
▓ ▓▓
|
||||
block 1 cyan boring
|
||||
▓
|
||||
block 2 cyan boring
|
||||
▓
|
||||
block 3 cyan boring
|
||||
▓
|
Loading…
Reference in New Issue
Block a user