action = TkMessageBox( 'Finished in' Time('S') - start_time 'seconds. Start a new game ?. Yes; continue, No; Quit, Cancel; Undo last move','No more moves!','yesnocancel','info' )
Select
When action = 'yes' Then Call TkEvent 'generate', '.', '<Control-n>'
When action = 'no' Then Call TkEvent 'generate', '.', '<Control-q>'
When action = 'cancel' Then Call TkEvent 'generate', '.', '<Control-z>'
Otherwise Nop
End
End
End
End
Return
Undo:
If undo_index = 0 Then Return
Select
When undo_card.undo_index = 'deal' Then /* undo a deal */
Do
number_of_deals = number_of_deals - 1
cards_in_deck = cards_in_deck + 4
Do i = 1 To 4
current_row = stack.i.0
Call TkCanvasDelete canvas, obj.i.current_row
stack.i.0 = stack.i.0 - 1
End
Call ShowNumberCards
End
When undo_from.undo_index = 0 Then /* get card back from discard pile */
Call TkInsert t2, 'end', '\nThe purpose of the game is to leave only the 4 aces on the playing area after all cards from the deck have been dealt.\n\n'
Call TkInsert t2, 'end', 'Rules of Play', 'raised'
Call TkInsert t2, 'end', '\nA card may be removed from the playing area if another card with a higher value (Ace highest, two lowest) of the same suit is fully exposed on another column. When an empty column occurs, any fully exposed card may be',
'moved into the empty column. When no more cards can be discarded, you must deal another 4 from the deck.\n\n'
Call TkInsert t2, 'end', 'Commands', 'raised'
Call TkInsert t2, 'end', '\nThe following mouse and key actions are supported:\n'