' variables DIM K AS INTEGER DIM SHARED PlayerName(3) AS STRING DIM SHARED NumberOfPlayers AS INTEGER DIM Player AS INTEGER DIM Time2Wait AS INTEGER DIM PlayGame AS STRING * 1 DIM Counter AS INTEGER DECLARE SUB waitSeconds (Seconds AS INTEGER) DECLARE SUB showLogo () DECLARE SUB getPlayerNames () DECLARE SUB explainGame () DECLARE SUB showWelcomeMessage () DECLARE SUB adjustSinglePlayer () CLS showLogo explainGame 'start game PlayGame = "Y" DO WHILE PlayGame = "Y" 'Initialise RANDOMIZE (TIMER) Time2Wait = 3 PlayGame = "Y" NumberOfPlayers = 0 Counter = 0 getPlayerNames Player = (RND * NumberOfPlayers) + 1 CLS showWelcomeMessage adjustSinglePlayer PRINT "SPINNING THE GUN, SEE WHO BEGINS" PRINT Player = INT(RND * NumberOfPlayers) K = INT(RND * 6) + 1 PRINT PlayerName(Player); " begins ..." PRINT "SPINNING THE CILINDER ... (TRRRRT...)" PRINT waitSeconds (4) DO WHILE K < 7 Counter = Counter + 1 'feedback to player PRINT "Pass the gun to "; PlayerName(Player); ". He has a"; INT(100 - (100 * (Counter / 6))); "% chance to survive this..." waitSeconds (Time2Wait) PRINT PlayerName(Player); " puts the gun to his head and pulls the trigger ..." waitSeconds (Time2Wait) IF K < 6 THEN PRINT "CLICK" PRINT "..." 'move gun to next player IF Player = NumberOfPlayers - 1 THEN Player = 0 ELSE Player = Player + 1 END IF ELSE 'game ends PRINT "PANG" PRINT PRINT PlayerName(Player); " just died, and lost the game" PRINT END IF K = K + 1 Time2Wait = Time2Wait + 1 LOOP INPUT "Wanna try again (Y/N)"; PlayGame PlayGame = UCASE$(PlayGame) Time2Wait = 3 CLS LOOP CLS PRINT "GAME OVER" END SUB adjustSinglePlayer 'correct for no input for player1 IF PlayerName(0) = "" THEN PlayerName(0) = "Challenger" NumberOfPlayers = 1 END IF 'add default opponent for single player IF NumberOfPlayers = 1 THEN NumberOfPlayers = 2 PlayerName(1) = "Boris" END IF END SUB SUB explainGame CLS PRINT "Play ..." PRINT PRINT " Russian Roulette" PRINT PRINT " ררררררר" PRINT PRINT "1 to 4 players can play. " PRINT "4 players seems a reasonable maximum." PRINT "The 4th player has 50% change that one of the player before him gets the bullet, and still a 33% change to get an empty chamber if the players befopre him survived." PRINT PRINT PRINT "You can also play alone, against 'Boris The Lucky Bastard'" PRINT PRINT "enter player names" PRINT "press [enter] when all players have entered their name." PRINT PRINT "good luck, and see you in hell ..." PRINT PRINT END SUB SUB getPlayerNames DIM i AS INTEGER PRINT "enter player name(s) : " FOR i = 0 TO 3 INPUT "-"; PlayerName(i) PRINT IF PlayerName(i) = "" THEN EXIT SUB END IF NumberOfPlayers = i + 1 NEXT END SUB SUB showLogo CLS PRINT PRINT PRINT PRINT " SILLY SOFTWARE PRODUCTIONS" PRINT PRINT " -=oOo=-" PRINT waitSeconds (5) CLS END SUB SUB showWelcomeMessage DIM i AS INTEGER DIM MSG AS STRING MSG = " Welcome to the game, " FOR i = 0 TO (NumberOfPlayers - 1) MSG = MSG + PlayerName(i) 'punctuation in msg IF i = NumberOfPlayers - 1 THEN MSG = MSG + "." ELSE MSG = MSG + ", " END IF 'special msg for single-player mode IF NumberOfPlayers = 1 THEN MSG = MSG + " You'll be playing against Boris The Lucky Bastard." END IF NEXT PRINT PRINT MSG END SUB SUB waitSeconds (Seconds AS INTEGER) ' Waits during a given number of seconds ThisMoment = TIMER DO UNTIL TIMER > ThisMoment! + Seconds IF TIMER < ThisMoment! THEN ThisMomemnt! = ThisMoment! - 86400 REM this takes care of Waiting 'till past midnight LOOP END SUB