2048: Difference between revisions

Content added Content deleted
(Update Seed7 example)
(Update Seed7 example)
Line 9,062: Line 9,062:
The Seed7 program below works in a text console.
The Seed7 program below works in a text console.
Commands are [http://seed7.sourceforge.net/libraries/keybd.htm#getc(in_console_keybd_file) read] from the file
Commands are [http://seed7.sourceforge.net/libraries/keybd.htm#getc(in_console_keybd_file) read] from the file
[http://seed7.sourceforge.net/libraries/keybd.htm#KEYBOARD KEYBOARD], which delivers cursor keys and function keys as single characters (e.g. KEY_LEFT or KEY_F1). Additionally KEYBOARD delivers single keypresses without echo.
[http://seed7.sourceforge.net/libraries/keybd.htm#KEYBOARD KEYBOARD], which delivers cursor keys and function keys as single characters (e.g. KEY_LEFT or KEY_F1). Additionally KEYBOARD delivers single key-presses without echo.
All this is done independend from the actual operating system or terminal.
All this is done independent from the operating system or terminal/console.
The output of the program is written to [http://seed7.sourceforge.net/libraries/console.htm#STD_CONSOLE STD_CONSOLE],
The output of the program is written to [http://seed7.sourceforge.net/libraries/console.htm#STD_CONSOLE STD_CONSOLE],
which allows [http://seed7.sourceforge.net/libraries/console.htm#setPos(in_console_file,in_integer,in_integer) cursor positioning],
which allows [http://seed7.sourceforge.net/libraries/console.htm#setPos(in_console_file,in_integer,in_integer) cursor positioning],
after it has been [http://seed7.sourceforge.net/libraries/console.htm#open(CONSOLE) opened].
after it has been [http://seed7.sourceforge.net/libraries/console.htm#open(CONSOLE) opened].
STD_CONSOLE works also always the same, independent from the operating system or terminal/console.


<lang seed7>$ include "seed7_05.s7i";
<lang seed7>$ include "seed7_05.s7i";