Scripting. Powershell, VMware, Windows, Active Directory & Exchange. All that kind of stuff…..
RSS icon Email icon Home icon
  • Friday Fun: PowerShell Noughts and Crosses (Tic-Tac-Toe)

    Posted on February 22nd, 2013 Jonathan Medd 1 comment

    OK, we all know it’s really called Noughts and Crosses, but to keep the search engines happy this is about Tic-Tac-Toe. While expanding my programming skills with another language I went through an exercise in this excellent book to create a Tic-Tac-Toe game. While at a loose end one evening, I thought I would take the logic, port it to PowerShell and add a few extra features. Nothing particularly clever in here, rather it’s an encouragement to break your code down into manageable functions.

    Oh and thanks to SoapyFrog for the code to make PowerShell ASCII Art….

    Start-TicTacToe

    Note:

    • PowerShell v3.0 is required, you can get that from here if you are not on that version.
    • It must be run from the PowerShell default console, not the ISE console.
    • Make sure you have the sound turned on :-)

    I’m off to see if I can get it take on a Nuclear Missile Launching Program….

     

    1 responses to “Friday Fun: PowerShell Noughts and Crosses (Tic-Tac-Toe)” RSS icon


    Leave a reply