The Rock Paper Scissors app plays Rock Paper Scissors against users. Each user can input a username which is stored in an SQLite3 Database. The goal of this program is to analyze the user’s subconcious patterns and beat the user.
Inside the rps.rb file, the Engine class is constructed with a hash that determines some of the configuration values. These values can be changed in order to test different configurations.
- max_search
-
The length of recent user history to use to search for patterns
- max_history
-
The total length of history to store
- analyze_user
-
Whether or not to analyze the user’s history
- analyze_computer
-
Whether or not to analyze the computer’s history
The database has a schema which can be used to query user results
- id
-
An autoincrementing integer that stores the user’s id
- name
-
The text value that stores the user’s name
- id
-
An autoincrementing integer that stores the game’s id
- search
-
The value for max_search for that game
- history
-
The value for max_history for that game
- analyze_user
-
The bit value for whether or not to analyze the user
- analyze_computer
-
The bit value for whether or not to analyze the computer
- user_id
-
The id of the user
- timestamp
-
The ruby timestamp of the game
- id
-
An autoincrementing integer that stores the turn’s id
- wins
-
The integer number of wins
- draws
-
The integer number of draws
- losses
-
The integer number of losses
- game_id
-
The id of the game