43a @verb #2124:"place" this none this rxdo #9780 @program #2124:"place" this none this "Copyright (C) Olivier Beaton (aka Quadir), all rights reserved." "Licensed under BSD, see http://www.opensource.org/licenses/bsd-license.php" "" "Syntax:" " :place( <, player>)" "--" "Puts the piece on the board." "E_RANGE -- Move not on Board" "E_QUOTA -- Board finished, reset" "E_NACC -- Column full" caller == this || (!this.restrict_calls && this:is_unlocked_for(caller_perms())) || raise(E_PERM) this.generic == this && raise(E_PERM, "No play on generic.") {col, ?play = this.player} = args grid = this.grid if (col <= 0 || col > this.width) return raise(E_RANGE) elseif (!this.running) return raise(E_QUOTA) elseif (grid[1][col]) return raise(E_NACC) endif fork (0) this:gameover() endfork for row in [1..length(grid)] row = length(grid) - row + 1 if (!grid[row][col]) this.player = !(this.player - 1) + 1 return this.grid[row][col] = play endif endfor "Last modified by Foenique (#4232) on Mon Oct 7 20:04:27 2002 MDT." . 0