Skip to main content

The Game

Ampscript TicTacToe


Last year I was inspired by a documentary about video game creators in the 80's and was amazed how they had to creatively work around the limitations of the hardware available at that time.

This got me thinking if I could build a game running purely on Ampscript. Sure, it's not as robust as Server-Side JavaScript, but hey, it has loops and conditional statements, so I guessed that's enough to tackle this challenge.

Didn't want to burn too many supermessages along the way, so the game had to be simple in scope and would need to be resolved with just a few clicks (with no script running client-side responding to the player) resulting in page reloads. Tic-Tac-Toe seemed like perfect choice for this, so I began coding.

The Game in Action

Play the game

Needles to say the game is now finished and you can play it by clicking the link: Ampscript Tic-Tac-Toe


  • a local multiplayer (PvP) mode where you can play against other players at the same device
  • a single player (PvE) mode where you play against the script


  • representing the board in Ampscript
  • checking if the game is finished resulting in a win or draw
  • creating an opponent that will play against you