BOUNCY language notes 3-DEC-2005 Program is a two-dimensional array of characters PC consists of (X, Y, direction, mode) direction is (north, dsSouth, east, west) mode is (normal, label, -- after 'L' and before ':' return, -- after ':' and before 'L' skip, -- east/south: after '(' and before next '(' -- west/north: after ')' and before next ')' digit, -- string of digits string) -- between double quotes space - normal: no operation (terminates digit entry) | - east/west flow bounces 180 degrees, north/south flow passes unchanged - - north/south flow bounces 180 degress, east/west flow passes unchanged / - bounce 90 degrees east flow turns north, south turns west, west turns south, north turns east \ - bounce 90 degrees east flow turns south, south turns east, west turns north, north turns west < - east bounces north or south depending on TOS north, south, bounces west west continues west > - west bounces north or south depending on TOS north, south, bounces east east continues east V - north bounces east or west depending on TOS east, west, bounces south south continues south ^ - south bounces east or west depending on TOS east, west, bounces north north continues north ( east or south: skip - ignores all chars until another '(' west or north: noop ) west or north: skip - ignores all chars until another ')' east or south: noop 0-9 . - digit entry (all other characters terminate digit entry) " - string entry - enter text mode, creates string on stack including characters through next " a - add (concatenates strings) s - subtract m - multiply d - divide m - mod = - compare i - integer part f - fractional part u - dUp - duplicate TOS r - dRop - discard TOS w - sWap - exchange TOS with NOS g - Get - save NOS in variable named by TOS p - Put - get contents of variable named by TOS G - Get array element P - Put array element t - prinT or Type n - print Newline L - label normal: enter label mode, which ignores digits until : return: return from subroutine : - end label normal: switch to return mode label: switch to normal mode J - jump to label (pops label number from stack) (disabled by default) S - call subroutine (pops label number from stack) Undefined: + ? ; ! @ # $ % & * _ [ ] { } ~ ` , Main program is subroutine at label 0.