Jump to content

2048: Difference between revisions

100 bytes added ,  5 years ago
Update Seed7 example
(Update Seed7 example)
(Update Seed7 example)
Line 9,062:
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
[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 keypresseskey-presses without echo.
All this is done independendindependent from the actual operating system or terminal/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],
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";
Cookies help us deliver our services. By using our services, you agree to our use of cookies.