Robots: Difference between revisions

m
syntax highlighting fixup automation
m (J: another bit of documentation)
m (syntax highlighting fixup automation)
 
Line 25:
We use two callbacks here: 'game_handler' to capture keyboard events, and 'sys_timer_z_' to capture timer events when the user uses the 'wait for game over' option.
 
<langsyntaxhighlight Jlang="j">require'~addons/ide/qt/gl2.ijs'
coinsert'jgl2'
 
Line 138:
 
wd'pc game closeok; setp wh 1280 720; cc chase isidraw flush;pshow'
start''</langsyntaxhighlight>
 
=={{header|Java}}==
Line 159:
(formerly Perl 6)
The bots single-mindedly chase you, taking the shortest path, ignoring obstacles. Use arrow keys to navigate your character(╂) around the board. Avoid bots(☗) and hazards(☢). "Kill" bots by causing them to crash into hazards or other bots. A dead bot creates another hazard. If you eliminate all of the bots on the board, another wave will spawn in random positions. If you touch a hazard or are touched by a bot, you die(†).
<syntaxhighlight lang="raku" perl6line>use Term::termios;
 
constant $saved = Term::termios.new(fd => 1).getattr;
Line 316:
print "\nSurvived " , $info , ' bots, but succumbed in the end.';
exit
}</langsyntaxhighlight>
{{out|Sample game}}
<pre>████████████████████████████████████████████████████████████████████████████████████████████████████
10,327

edits