Skip to content

Instantly share code, notes, and snippets.

@Draknek
Last active December 27, 2022 01:27
Show Gist options
  • Save Draknek/b30d2a52b6125151fb3ddd03c781e3ed to your computer and use it in GitHub Desktop.
Save Draknek/b30d2a52b6125151fb3ddd03c781e3ed to your computer and use it in GitHub Desktop.
Sokobond Express demake (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Sokobond Express demake
author Alan Hazelden
(verbose_logging)
noaction
========
OBJECTS
========
Background
#e8e8e8 grey
11111
10001
10001
10001
11111
SpawnTile
darkgrey transparent
11111
10001
10001
10001
11111
Void
lightgrey
TargetFromL ↦
darkgrey
.....
.000.
00.0.
.000.
.....
TargetFromR ↤
darkgrey
.....
.000.
.0.00
.000.
.....
TargetFromU ↧
darkgrey
..0..
.000.
.0.0.
.000.
.....
TargetFromD ↥
darkgrey
.....
.000.
.0.0.
.000.
..0..
Wall
brown darkbrown
00010
11111
01000
11111
00010
Player
darkgrey
00000
0...0
0...0
0...0
00000
Hydrogen
#fe867e
.....
.000.
.000.
.000.
.....
Oxygen
#93b5e8
.....
.000.
.000.
.000.
.....
Nitrogen
#9ac081
.....
.000.
.000.
.000.
.....
Carbon
#ffd27d
.....
.000.
.000.
.000.
.....
1Electron
white
.....
.0...
.....
.....
.....
2Electron
white
.....
.0...
.....
...0.
.....
3Electron
white
.....
.0.0.
.....
...0.
.....
4Electron
white
.....
.0.0.
.....
.0.0.
.....
Missing1Electron
darkblue
.....
.....
.....
.0...
.....
Missing2Electron
darkblue
.....
...0.
.....
.0...
.....
Missing3Electron
darkblue
.....
...0.
.....
.0.0.
.....
Missing4Electron
darkblue
.....
.0.0.
.....
.0.0.
.....
BondL
darkbrown
.....
.....
0....
.....
.....
BondR
darkbrown
.....
.....
....0
.....
.....
BondU
darkbrown
..0..
.....
.....
.....
.....
BondD
darkbrown
.....
.....
.....
.....
..0..
Counter0
brown
.....
.000.
.0.0.
.000.
.....
Counter1
brown
.....
.....
..0..
.....
.....
Counter2
brown
.....
..0..
.....
..0..
.....
Counter3
brown
.....
..0..
...0.
..0..
.....
PathL →
darkgrey
.....
000..
0000.
000..
.....
PathR ←
darkgrey
.....
..000
.0000
..000
.....
PathU ↓
darkgrey
.000.
.000.
.000.
..0..
.....
PathD ↑
darkgrey
.....
..0..
.000.
.000.
.000.
Ignore
red
=======
LEGEND
=======
. = Background
_ = Void
# = Wall
P = Player
H = Hydrogen and 1Electron and SpawnTile
O = Oxygen and 2Electron and SpawnTile
N = Nitrogen and 3Electron and SpawnTile
C = Carbon and 4Electron and SpawnTile
a = Hydrogen and Missing1Electron and SpawnTile
b = Oxygen and Missing1Electron and SpawnTile and 1Electron
d = Nitrogen and Missing1Electron and SpawnTile and 2Electron
e = Carbon and Missing1Electron and SpawnTile and 3Electron
1 = Player and H
2 = Player and O
3 = Player and N
4 = Player and C
5 = Player and Hydrogen and Missing1Electron and SpawnTile
6 = Player and Oxygen and Missing1Electron and SpawnTile and 1Electron
7 = Player and Nitrogen and Missing1Electron and SpawnTile and 2Electron
8 = Player and Carbon and Missing1Electron and SpawnTile and 3Electron
9 = Player and Oxygen and Missing2Electron and SpawnTile
0 = Player and Nitrogen and Missing2Electron and SpawnTile and 1Electron
z = Player and Carbon and Missing2Electron and SpawnTile and 2Electron
y = Player and Nitrogen and Missing3Electron and SpawnTile
x = Player and Carbon and Missing3Electron and SpawnTile and 1Electron
w = Player and Carbon and Missing4Electron and SpawnTile
, = 1Electron and SpawnTile
; = 2Electron and SpawnTile
Electrons = 1Electron or 2Electron or 3Electron or 4Electron
Atom = Hydrogen or Oxygen or Nitrogen or Carbon
MissingElectrons = Missing1Electron or Missing2Electron or Missing3Electron or Missing4Electron
Solid = Atom or Wall or Electrons
MoveBlockedHere = SpawnTile or Void
Bond = BondL or BondR or BondU or BondD
Attached = Player or Bond
Counter = Counter0 or Counter1 or Counter2 or Counter3
LessThan2Electrons = 1Electron
LessThan3Electrons = 1Electron or 2Electron
LessThan2MissingElectrons = Missing1Electron
LessThan3MissingElectrons = Missing1Electron or Missing2Electron
Path = PathL or PathR or PathU or PathD
Target = TargetFromL or TargetFromR or TargetFromU or TargetFromD
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
Background
Target, Void, SpawnTile
PathL
PathR
PathU
PathD
Atom
Electrons
MissingElectrons
Player, Wall
BondL
BondR
BondU
BondD
Counter, Ignore
======
RULES
======
(check undo)
(apply bond directions)
[ BondL ] -> [ left BondL ]
[ BondR ] -> [ right BondR ]
[ BondU ] -> [ up BondU ]
[ BondD ] -> [ down BondD ]
(apply movement directions)
[ > Player | MoveBlockedHere ] -> cancel
[ > Player Atom | ] -> [ > Player > Atom | ]
[ moving Atom > Bond | stationary Atom ] -> [ moving Atom > Bond | moving Atom ]
[ Bond ] -> [ stationary Bond ]
[ > Atom Bond ] -> [ > Atom > Bond ]
[ > Atom Electrons ] -> [ > Atom > Electrons ]
[ > Atom MissingElectrons ] -> [ > Atom > MissingElectrons ]
(check validity)
[ > Player Target ] -> cancel
[ > Player SpawnTile | no Path ] -> cancel
[ > Player no SpawnTile | Path ] -> cancel
left [ Target no TargetFromL | < Player ] -> cancel
right [ Target no TargetFromR | < Player ] -> cancel
up [ Target no TargetFromU | < Player ] -> cancel
down [ Target no TargetFromD | < Player ] -> cancel
[ > Atom | stationary Solid ] -> cancel
(do movement)
[ > Atom | no Atom ] -> [ | Atom ]
[ > Electrons | no Electrons ] -> [ | Electrons ]
[ > MissingElectrons | no MissingElectrons ] -> [ | MissingElectrons ]
[ > BondL | no BondL ] -> [ | BondL ]
[ > BondR | no BondR ] -> [ | BondR ]
[ > BondU | no BondU ] -> [ | BondU ]
[ > BondD | no BondD ] -> [ | BondD ]
left [ > Player | ] -> [ PathL | PathR Player ]
right [ > Player | ] -> [ PathR | PathL Player ]
up [ > Player | ] -> [ PathU | PathD Player ]
down [ > Player | ] -> [ PathD | PathU Player ]
(check we're not colliding with level edges)
[ > Atom ] -> cancel
(add electrons from level)
[ Attached MissingElectrons | Electrons no Atom ] -> [ Attached MissingElectrons Counter0 | Electrons Counter0 ]
startloop
random [ stationary Counter0 ] -> [ action Counter0 ]
random [ no Atom action Counter0 | stationary MissingElectrons Counter ] -> [ action Counter1 | action MissingElectrons Counter ]
random [ no Atom action Counter1 | stationary MissingElectrons Counter ] -> [ action Counter2 | action MissingElectrons Counter ]
random [ no Atom action Counter2 | stationary MissingElectrons Counter ] -> [ action Counter3 | action MissingElectrons Counter ]
random [ action Counter0 | stationary Electrons Counter no Atom ] -> [ action Counter1 | action Electrons Counter ]
random [ action Counter1 | stationary Electrons Counter no Atom ] -> [ action Counter2 | action Electrons Counter ]
random [ action Counter2 | stationary Electrons Counter no Atom ] -> [ action Counter3 | action Electrons Counter ]
[ action Electrons ] -> [ Electrons ]
[ action MissingElectrons ] -> [ MissingElectrons ]
[ action Counter ] -> [ Counter ]
endloop
[ Counter3 LessThan3MissingElectrons ] -> [ LessThan3MissingElectrons ]
[ Counter2 LessThan2MissingElectrons ] -> [ LessThan2MissingElectrons ]
[ Counter3 LessThan3Electrons ] -> [ LessThan3Electrons ]
[ Counter2 LessThan2Electrons ] -> [ LessThan2Electrons ]
left [ no Atom Counter | Atom Counter ] -> [ Counter > BondL | Atom Counter ]
right [ no Atom Counter | Atom Counter ] -> [ Counter > BondR | Atom Counter ]
up [ no Atom Counter | Atom Counter ] -> [ Counter > BondU | Atom Counter ]
down [ no Atom Counter | Atom Counter ] -> [ Counter > BondD | Atom Counter ]
startloop
random [ > Bond no Atom | MissingElectrons ] -> [ action Bond | action MissingElectrons ]
[ action MissingElectrons 3Electron ] -> [ action MissingElectrons 4Electron ]
[ action MissingElectrons 2Electron ] -> [ action MissingElectrons 3Electron ]
[ action MissingElectrons 1Electron ] -> [ action MissingElectrons 2Electron ]
[ action MissingElectrons no Electrons ] -> [ action MissingElectrons 1Electron ]
[ action Missing4Electron ] -> [ Missing3Electron ]
[ action Missing3Electron ] -> [ Missing2Electron ]
[ action Missing2Electron ] -> [ Missing1Electron ]
[ action Missing1Electron ] -> []
endloop
[ action Bond 4Electron no Atom ] -> [ 3Electron ]
[ action Bond 3Electron no Atom ] -> [ 2Electron ]
[ action Bond 2Electron no Atom ] -> [ 1Electron ]
[ action Bond 1Electron no Atom ] -> []
[ Counter ] -> []
[ Bond no Atom ] -> []
(bond)
[ Atom Attached Electrons | Atom Electrons no Attached ] -> [ Atom Attached Electrons Counter0 | Atom Electrons Counter0 ]
[ Electrons no Counter ] -> [ Electrons Ignore ]
startloop
random [ stationary Counter0 ] -> [ action Counter0 ]
random [ action Counter0 | stationary Atom Electrons Counter ] -> [ action Counter1 | action Atom Electrons Counter ]
random [ action Counter1 | stationary Atom Electrons Counter ] -> [ action Counter2 | action Atom Electrons Counter ]
random [ action Counter2 | stationary Atom Electrons Counter ] -> [ action Counter3 | action Atom Electrons Counter ]
[ action Atom ] -> [ Atom ]
[ action Counter ] -> [ Counter ]
endloop
[ Counter0 ] -> []
[ Counter3 LessThan3Electrons ] -> [ LessThan3Electrons ]
[ Counter2 LessThan2Electrons ] -> [ LessThan2Electrons ]
right [ Counter Electrons | Counter Electrons ] -> [ Counter Electrons action BondR | Counter Electrons action BondL ]
down [ Counter Electrons | Counter Electrons ] -> [ Counter Electrons action BondD | Counter Electrons action BondU ]
[ action Bond 4Electron ] -> [ Bond 3Electron ]
[ action Bond 3Electron ] -> [ Bond 2Electron ]
[ action Bond 2Electron ] -> [ Bond 1Electron ]
[ action Bond 1Electron ] -> [ Bond ]
[ Counter ] -> []
(second bond)
[ Atom Attached Electrons | Atom Electrons no Ignore ] -> [ Atom Attached Electrons Counter0 | Atom Electrons Counter0 ]
[ Electrons no Counter ] -> [ Electrons Ignore ]
startloop
random [ stationary Counter0 ] -> [ action Counter0 ]
random [ action Counter0 | stationary Atom Electrons Counter ] -> [ action Counter1 | action Atom Electrons Counter ]
random [ action Counter1 | stationary Atom Electrons Counter ] -> [ action Counter2 | action Atom Electrons Counter ]
random [ action Counter2 | stationary Atom Electrons Counter ] -> [ action Counter3 | action Atom Electrons Counter ]
[ action Atom ] -> [ Atom ]
[ action Counter ] -> [ Counter ]
endloop
[ Counter0 ] -> []
[ Counter3 LessThan3Electrons ] -> [ LessThan3Electrons ]
[ Counter2 LessThan2Electrons ] -> [ LessThan2Electrons ]
right [ Counter Electrons | Counter Electrons ] -> [ Counter Electrons action BondR | Counter Electrons action BondL ]
down [ Counter Electrons | Counter Electrons ] -> [ Counter Electrons action BondD | Counter Electrons action BondU ]
[ action Bond 4Electron ] -> [ Bond 3Electron ]
[ action Bond 3Electron ] -> [ Bond 2Electron ]
[ action Bond 2Electron ] -> [ Bond 1Electron ]
[ action Bond 1Electron ] -> [ Bond ]
[ Counter ] -> []
(third bond)
[ Atom Attached Electrons | Atom Electrons no Ignore ] -> [ Atom Attached Electrons Counter0 | Atom Electrons Counter0 ]
[ Electrons no Counter ] -> [ Electrons Ignore ]
startloop
random [ stationary Counter0 ] -> [ action Counter0 ]
random [ action Counter0 | stationary Atom Electrons Counter ] -> [ action Counter1 | action Atom Electrons Counter ]
random [ action Counter1 | stationary Atom Electrons Counter ] -> [ action Counter2 | action Atom Electrons Counter ]
random [ action Counter2 | stationary Atom Electrons Counter ] -> [ action Counter3 | action Atom Electrons Counter ]
[ action Atom ] -> [ Atom ]
[ action Counter ] -> [ Counter ]
endloop
[ Counter0 ] -> []
[ Counter3 LessThan3Electrons ] -> [ LessThan3Electrons ]
[ Counter2 LessThan2Electrons ] -> [ LessThan2Electrons ]
right [ Counter Electrons | Counter Electrons ] -> [ Counter Electrons action BondR | Counter Electrons action BondL ]
down [ Counter Electrons | Counter Electrons ] -> [ Counter Electrons action BondD | Counter Electrons action BondU ]
[ action Bond 4Electron ] -> [ Bond 3Electron ]
[ action Bond 3Electron ] -> [ Bond 2Electron ]
[ action Bond 2Electron ] -> [ Bond 1Electron ]
[ action Bond 1Electron ] -> [ Bond ]
[ Counter ] -> []
(cleanup)
[ Ignore ] -> []
==============
WINCONDITIONS
==============
=======
LEVELS
=======
(levels from subatomic wire)
(subatomic wire level 13)
_________
_________
__9→..h__
__.....__
__..,..__
__h.,↧.__
__#....__
_________
_________
(subatomic wire level 13, updated by Alan)
__________
__________
__9→....__
__......__
__..,_↧.__
__h.,...__
__.....h__
__________
__________
(subatomic wire level 14)
____________
____________
__...,h...__
__......9.__
__.↧....↓.__
__...h,...__
____________
____________
(subatomic wire level 15)
____________
____________
___......___
___.,....___
__#...h..#__
__9→.....↦__
__#...h..#__
___.,....___
___......___
____________
____________
(subatomic wire level 16)
____________
___h.....___
___......↦__
__#..,,..#__
__9→.....___
___.....h___
____________
____________
(subatomic wire level 17)
____________
______↥_____
__........__
__.,....,.__
__........__
__........__
__........__
__.h#..#h.__
__...↑....__
_____9______
____________
(subatomic wire level 17, updated by Alan)
____________
_____.↥_____
__........__
__.,....,.__
__........__
__........__
__.._.._..__
__.h....h.__
__...↑....__
_____9._____
____________
(subatomic wire level 18)
_____________
_____________
__.........__
__.h.....,.__
__.#.....#.__
__...h,h...__
__.........__
__↤......←0__
_____________
_____________
(subatomic wire level 18, updated by Alan)
_____________
_____________
__.........__
__.h.....,.__
__._....._.__
__.........__
__...h,h...__
__.........__
__.↦.....0→__
_____________
_____________
(subatomic wire level 19)
_____________
_____y_______
__...↓.....__
__,...h...,__
__#.......#__
__.........__
__.h..,..h.__
__.........__
_______↧_____
_____________
_____________
(subatomic wire level 19, updated by Alan)
_____________
______y______
__....↓....__
__,...h...,__
___.......___
__.........__
__.h..,..h.__
__.........__
_____.↧._____
_____________
_____________
(subatomic wire level 20)
_____________
_____________
__.........__
__.h.......__
__.#h...,,.__
__.........__
__.........__
__↑.....h#.__
__z......h.__
__.↤.......__
_____________
_____________
(subatomic wire level 20, updated by Alan)
_____________
_____________
__.........__
__.h....,,.__
__..h...,,.__
__.........__
__.........__
__↑.....h..__
__w↥.....h.__
__.........__
_____________
_____________
_____________
_____________
__.........__
__..h...,,.__
__.h....,,.__
__.........__
__.........__
__↑......h.__
__w↥....h..__
__.........__
_____________
_____________
(subatomic wire level 22)
______________
______________
___w__________
__.↓........__
__..........__
__..hh,,hh..__
__..,....,..__
__..........__
__..........__
__________↧___
______________
______________
(subatomic wire level 22, updated by Alan)
______________
______________
___x__________
__.↓.......___
__.........___
__..hh,hh..___
__..,...,..___
__....↧....___
__.........___
______________
______________
(Alan's levels)
___________
___________
__.......__
__...o..↥__
__.1→....__
__...o..h__
__.......__
___________
___________
________________
________________
________________
____....←3______
___.......______
___o.o.o.h↥..___
___..........___
____....h....___
_________...h___
________________
________________
________________
________________
________________
__.....←6_______
__......._______
__b.n...,.....__
__.......h.,.↦__
__.....h....h.__
________________
________________
______________
______________
__..b.._______
__....._______
__n...._______
__....,.....__
__.....h.,.↦__
__6→.h....h.__
______________
______________
______________
______________
__......._____
__.n....._____
__.....←6_____
__....,.....__
__.b...h.,.↦__
__...h....h.__
______________
______________
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment