--- gforth/sokoban.fs 1995/11/27 18:37:07 1.2 +++ gforth/sokoban.fs 2007/12/31 18:40:24 1.8 @@ -1,5 +1,22 @@ \ sokoban - a maze game in FORTH +\ Copyright (C) 1995,1997,1998,2003 Free Software Foundation, Inc. + +\ This file is part of Gforth. + +\ Gforth is free software; you can redistribute it and/or +\ modify it under the terms of the GNU General Public License +\ as published by the Free Software Foundation, either version 3 +\ of the License, or (at your option) any later version. + +\ This program is distributed in the hope that it will be useful, +\ but WITHOUT ANY WARRANTY; without even the implied warranty of +\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +\ GNU General Public License for more details. + +\ You should have received a copy of the GNU General Public License +\ along with this program. If not, see http://www.gnu.org/licenses/. + \ Contest from Rick VanNorman in comp.lang.forth \ SOKOBAN @@ -28,7 +45,6 @@ Create maze 1 cells allot /maze 25 * al Variable mazes 0 mazes ! \ root pointer Variable soko 0 soko ! \ player position Variable >maze 0 >maze ! \ current compiled maze ->maze off \ score information @@ -119,6 +135,8 @@ Variable score 0 score ! \ total nu S" &." S" .&" r@ play-rule IF r> soko +! EXIT THEN S" &* " S" .&$" r@ play-rule IF r> soko +! 1 rocks +! -1 score +! EXIT THEN + S" &$." S" .@*" r@ play-rule + IF r> soko +! -1 rocks +! 1 score +! EXIT THEN -1 moves +! r> drop ; 1 move: soko-right