jalih
Joined: 30 Jul 2012 Posts: 196
|
Posted: Mon Jul 07, 2014 10:04 am Post subject: AI program |
|
|
I wrote a simple program in PL/I to compete at the AI contest:
Rules of the game:
Game has two players and 1000 rounds. Each round both players choose a whole number between 0-9. Both players score points the amount of the smaller number, also player that chose the smaller number gets three extra points. If the answers are the same, both players score one extra point.
My program:
I chose to use Hopfield neural network as autoassociative memory. I record the three last opponent's moves and train the network with that history as bit-vector. To get the most likely opponent's next answer, just feed all the possibilities into the network and choose the one with least bit-errors on recall.
My PL/I program with source and binary is available here. It takes the number of rounds as first input and after that numbers 0-9 as input. It outputs the opponent's most likely next move and the number it chooses based on that (first three AI answers are always 0).
How would you write the code in Fortran? |
|