Page MenuHomePhabricator

D20085.id47958.diff
No OneTemporary

D20085.id47958.diff

Index: scripts/breakout.py
===================================================================
--- scripts/breakout.py
+++ scripts/breakout.py
@@ -79,7 +79,7 @@
win.addch(self.y, self.x, 'O')
except curses.error:
Ball.alive = False
- Ball.killed += 1
+ Ball.killed += 1000
return Ball.alive
class Ship:
@@ -141,11 +141,11 @@
height, width = stdscr.getmaxyx()
- if height < 15 or width < 30:
+ if height < 15 or width < 32:
raise PowerOverwhelmingException(
- "Your computer is not powerful enough to run 'arc anoid'. "
- "It must support at least 30 columns and 15 rows of next-gen "
- "full-color 3D graphics.")
+ 'Your computer is not powerful enough to run "arc anoid". '
+ 'It must support at least 32 columns and 15 rows of next-gen '
+ 'full-color 3D graphics.')
status = curses.newwin(1, width, 0, 0)
height -= 1
@@ -194,7 +194,15 @@
status.addstr('%s/%s ' % (Block.killed, Block.total), curses.A_BOLD)
status.addch(curses.ACS_VLINE)
status.addstr(' DEATHS: ', curses.A_BOLD | curses.color_pair(4))
- status.addstr('%s ' % Ball.killed, curses.A_BOLD)
+
+ # See T8693. At the minimum display size, we only have room to render
+ # two characters for the death count, so just display "99" if the
+ # player has more than 99 deaths.
+ display_deaths = Ball.killed
+ if (display_deaths > 99):
+ display_deaths = 99
+
+ status.addstr('%s ' % display_deaths, curses.A_BOLD)
status.addch(curses.ACS_LTEE)
if Block.killed == Block.total:
Index: src/workflow/ArcanistAnoidWorkflow.php
===================================================================
--- src/workflow/ArcanistAnoidWorkflow.php
+++ src/workflow/ArcanistAnoidWorkflow.php
@@ -6,24 +6,23 @@
return 'anoid';
}
- public function getCommandSynopses() {
- return phutil_console_format(<<<EOTEXT
- **anoid**
-EOTEXT
- );
+ public function getWorkflowInformation() {
+ $help = pht(
+ 'Use your skills as a starship pilot to escape from the Arcanoid. '.
+ 'System requirements: a color TTY with character resolution 32x15.');
+
+ return $this->newWorkflowInformation()
+ ->setHelp($help);
}
- public function getCommandHelp() {
- return phutil_console_format(<<<EOTEXT
- There's only one way to find out...
-EOTEXT
- );
+ public function getWorkflowArguments() {
+ return array();
}
- public function run() {
- phutil_passthru(
- '%s/scripts/breakout.py',
- dirname(phutil_get_library_root('arcanist')));
+ public function runWorkflow() {
+ $root_path = dirname(phutil_get_library_root('arcanist'));
+ $game_path = $root_path.'/scripts/breakout.py';
+ return phutil_passthru('%s', $game_path);
}
}

File Metadata

Mime Type
text/plain
Expires
Thu, May 9, 4:21 AM (3 w, 16 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6273998
Default Alt Text
D20085.id47958.diff (2 KB)

Event Timeline