going-places.chr
· 726 B · Text
Raw
Playground
go_back, travel_sym(Id), at(FutureLocation)
, history(GrandparentId, LastLocation, ParentId), history(ParentId, Location)
<=> history(GrandparentId, LastLocation)
, at(Location)
, travel_sym(ParentId)
go_back, travel_sym(FutureID), at(FutureLocation), history(Id, Location)
<=> at(Location)
, travel_sym(Id)
go_back <=> nowhere_to_go
go_to(NewLocation), at(Location), history(ParentId, LastLocation), travel_sym(Id)
<=> history(ParentId, LastLocation, Id), history(Id, Location)
, at(NewLocation)
, travel_sym(Id + 1)
go_to(NewLocation), travel_sym(Id), at(Location)
<=> history(Id, Location)
, at(NewLocation)
, travel_sym(Id + 1)
start <=> at("Home"), travel_sym(0)
| 1 | go_back, travel_sym(Id), at(FutureLocation) |
| 2 | , history(GrandparentId, LastLocation, ParentId), history(ParentId, Location) |
| 3 | <=> history(GrandparentId, LastLocation) |
| 4 | , at(Location) |
| 5 | , travel_sym(ParentId) |
| 6 | |
| 7 | go_back, travel_sym(FutureID), at(FutureLocation), history(Id, Location) |
| 8 | <=> at(Location) |
| 9 | , travel_sym(Id) |
| 10 | |
| 11 | go_back <=> nowhere_to_go |
| 12 | |
| 13 | go_to(NewLocation), at(Location), history(ParentId, LastLocation), travel_sym(Id) |
| 14 | <=> history(ParentId, LastLocation, Id), history(Id, Location) |
| 15 | , at(NewLocation) |
| 16 | , travel_sym(Id + 1) |
| 17 | |
| 18 | |
| 19 | go_to(NewLocation), travel_sym(Id), at(Location) |
| 20 | <=> history(Id, Location) |
| 21 | , at(NewLocation) |
| 22 | , travel_sym(Id + 1) |
| 23 | |
| 24 | start <=> at("Home"), travel_sym(0) |