@@ -224,20 +224,20 @@ void doTurnRoll()
224224 {
225225 if (!benchmarkMode )
226226
227- #ifndef __APPLE2__
228- j = getJiffies ();
229- do {
230- #endif
227+ #ifndef __APPLE2__
228+ j = getJiffies ();
229+ do
230+ {
231+ #endif
231232
232233 for (i = 0 ; i < 20 ; ++ i )
233234 {
234235 doSingleRoll ();
235236 }
236237
237- #ifndef __APPLE2__
238- } while (getJiffies ()- j < 60 );
239- #endif
240-
238+ #ifndef __APPLE2__
239+ } while (getJiffies () - j < 60 );
240+ #endif
241241 }
242242 else
243243 {
@@ -536,44 +536,95 @@ void startBenchmarkMode()
536536 srand (seed );
537537}
538538
539- void startgame ()
539+ void bannerDice ()
540540{
541541 char i ;
542-
543- textcolor (colSplash );
542+ textcolor (colDice );
544543
545544 clrscr ();
546545 for (i = 0 ; i < 8 ; ++ i )
547546 {
548547 _plotDice (1 + (rand () % 6 ), i * 5 , 0 , 0 );
549548 _plotDice (1 + (rand () % 6 ), i * 5 , BOTTOMY - 4 , 0 );
550549 }
550+ }
551551
552+ void displayCredits ()
553+ {
554+ bannerDice ();
552555 textcolor (colText );
556+ revers (1 );
557+ centerLine (7 , " * k k n i f f e l * " );
558+ revers (0 );
559+ centerLine (9 , "written by stephan kleinert" );
560+ centerLine (10 , "at k-burg, bad honnef and" );
561+ centerLine (11 , "at hundehaus im reinhardswald" );
562+ centerLine (12 , "2019/20" );
563+ centerLine (14 , "with very special thanks to" );
564+ centerLine (15 , "frau k., buba k. candor k." );
565+ centerLine (16 , "and the seven turtles!" );
566+ centerLine (18 , "-- key --" );
567+ cgetc ();
568+ }
553569
570+ void displayInstructions ()
571+ {
572+ bannerDice ();
573+ textcolor (colText );
554574 revers (1 );
555- centerLine (6 , " * k k n i f f e l * " );
575+ centerLine (7 , " * instructions * " );
556576 revers (0 );
557- centerLine (8 , "- version 2.4 -" );
558- centerLine (10 , "written by stephan kleinert" );
559- centerLine (11 , "at k-burg, bad honnef, 2019-2020" );
560- centerLine (12 , "with special thanks to frau k.," );
561- centerLine (13 , "buba k., candor k. and of course" );
562- centerLine (14 , "to the 7 turtles." );
563- textcolor (colLowerSum );
564- centerLine (16 , "how many players (2-4)?" );
577+ centerLine (9 , "game keys:" );
578+ centerLine (11 , "<return> to roll or reroll the dice" );
579+ centerLine (13 , "<1-6> to select dice to reroll" );
580+ centerLine (14 , "<a-m> to choose category to score" );
581+ centerLine (16 , "<s> to sort the dice" );
582+ centerLine (18 , "-- key --" );
583+ cgetc ();
584+ }
585+
586+ void startgame ()
587+ {
588+ char i ;
589+ char c ;
590+ char promptTopRow ;
591+
592+ promptTopRow = (BOTTOMY / 2 ) - 5 ;
565593
566- while ( numPlayers < 2 || numPlayers > 4 )
594+ do
567595 {
596+ bannerDice ();
597+ textcolor (colText );
598+
599+ revers (1 );
600+ centerLine (promptTopRow , (char * )gTitle );
601+ revers (0 );
602+ centerLine (promptTopRow + 2 , "- version 2.32 -" );
603+ centerLine (promptTopRow + 3 , "written by stephan kleinert" );
604+ textcolor (colBonus );
605+ centerLine (promptTopRow + 8 , "or type 'i' for instructions" );
606+ centerLine (promptTopRow + 9 , "or 'c' for credits" );
607+ textcolor (colLowerSum );
608+ centerLine (promptTopRow + 6 , "how many players (2-4)?" );
609+
568610 cursor (1 );
569- numPlayers = cgetc () - '0' ;
611+ c = cgetc ();
612+ numPlayers = c - '0' ;
570613 cursor (0 );
571- if (numPlayers == 18 )
572- { // 'b' typed
614+ if (c == 'i' )
615+ {
616+ displayInstructions ();
617+ }
618+ else if (c == 'c' )
619+ {
620+ displayCredits ();
621+ }
622+ else if (c == '#' )
623+ {
573624 startBenchmarkMode ();
574625 return ;
575626 }
576- }
627+ } while ( numPlayers < 2 || numPlayers > 4 );
577628
578629 clrscr ();
579630
0 commit comments