DEV Community

Discussion on: Tell me a coding confession

Collapse
 
david_j_eddy profile image
David J Eddy

My first real computer program was written in Basic on the C64; tic-tac-toe.

  • If human went first, the round ended in a tie
  • If the C64 went first, it would win ....it took me the better part of 6 months in middle school to get it to work.
Collapse
 
jackharner profile image
Jack Harner 🚀

My dad first introduced me to programming by helping me make tic tac toe with Visual Basic in Excel. We never finished it, but I went back and did it with Javascript a while ago.

Collapse
 
fnh profile image
Fabian Holzer

It is impossible in the 3x3 grid to win by setting the first marker, the opponent player can always force a draw - although in second position against an optimal player it is also impossible to win. So, your game might have won easily against opponents with a non-optimal strategy.

Collapse
 
david_j_eddy profile image
David J Eddy

Very possible, I was 12 when I wrote it.