War Games

using System;
using System.Text;
using WOPR;
using WOPR.Joshua;

namespace WarGames
{
    class BackDoor
    {
        public static BackDoor();
        {
            string userInput;

            Console.WriteLine("SHALL WE PLAY A GAME?")
            userInput = Console.ReadLine();

            if (userInput == "GLOBAL THERMONUCLEAR WAR")
            {
                WOPR.MissileLaunch();
            }
            else
            {
                WOPR.Chess();
            }
        }
       
    }
}
Vote up this code0
  • http://radmer.myopenid.com/ Radmer

    There’s missing something like:

    for(int i=10000; i>0, i–)
    {
    if (WORP.TicTacToe().Success)
    {
    WORP.MissileLaunch();
    return;
    }
    }

    • David Kirchner

      PHP:

      $characters = str_split (’0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ’, 1);
      $password = str_split (‘CPE1704TKS’, 1);
      $guess = array ();

      do {
      for ($n = 0; $n < count($password); $n++) {
      if (count($guess) <= $n || $guess[$n] != $password[$n]) {
      $guess[$n] = $characters[rand(0, count($characters) - 1)];
      }
      }

      print implode ('', $guess) . "r";
      usleep (120000);
      } while ($guess != $password);
      print "n";