version 1.3, 1997/02/16 20:51:11
|
version 1.5, 2003/03/09 12:54:33
|
Line 1
|
Line 1
|
\ sokoban - a maze game in FORTH |
\ sokoban - a maze game in FORTH |
|
|
|
\ Copyright (C) 1995,1997,1998 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 2 |
|
\ 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, write to the Free Software |
|
\ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. |
|
|
\ Contest from Rick VanNorman in comp.lang.forth |
\ Contest from Rick VanNorman in comp.lang.forth |
|
|
\ SOKOBAN |
\ SOKOBAN |
Line 118 Variable score 0 score ! \ total nu
|
Line 136 Variable score 0 score ! \ total nu
|
S" &." S" .&" r@ play-rule IF r> soko +! EXIT THEN |
S" &." S" .&" r@ play-rule IF r> soko +! EXIT THEN |
S" &* " S" .&$" r@ play-rule |
S" &* " S" .&$" r@ play-rule |
IF r> soko +! 1 rocks +! -1 score +! EXIT THEN |
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 moves +! r> drop ; |
|
|
1 move: soko-right |
1 move: soko-right |