Course:CPSC312-2016-not-my-number

From UBC Wiki

Authors: Hyojin Yi, Justin Yi Ting Song

What is the problem?

'Not My Number' (working title) is another min(e/d) game -- this is supposed to be punny. The objective? Leave your opponent have no choice but to step on the 'mine'. The game begins with the computer planting a 'mine' and as each player takes turns making a move, the 'safe' area begins to shrink to increase the chances of finding the 'mine' before the next player's turn, if the player who is making the turn did not find the 'mine' him/herself.

Logistics

Members: Computer, Player1, Player2
GameState: starts with array of [1, 100]

When the game starts, a "bomb" is automatically planted in a game field represented by a matrix from 1 to 100 (inclusive) — bomb is at location B.
Then, the user(s) can choose which mode to play: 2-player, easy mode, medium mode or hard mode. The difficulty of a mode depends on how much the interval is shrunk by the computer on average.
After choosing who starts first, Player1 needs to pick a number, X from [1, 100]. If X < B, x becomes the new lower limit and Player2 must choose a number from [X+1, 100]. if X > B, X becomes the new upper limit and Player2 must choose a number between [1, X-1]. On the next turn Player2 chooses a number, y. The interval shrinks to either [X, Y-1] or [Y+1, X].
The interval always contains the value B and continues to shrink until one of the player chooses the bomb. During the process, the chances of Player1 or Player2 choosing B increases as the possible number of choices decrease.

What is the something extra?

  • Different modes of the game: the user get to choose play against another player or computer
  • Different difficulties of opponent (computer): makes the game suitable for players of different level/age
  • Tournament system: keeps tracks of how many wins and losses for each player

Development area

https://github.com/hjy0102/not_my_number

What did we learn from doing this?

Adding extra features to the game is where we learn the most. Because we have different modes, the game have to be able to generate different type of players (computer or user). Moves of the user are from IO while computer can generate moves inside the program, so game state have to switch back and forth when the game proceeds. Additionally, different difficulties need different algorithms to support the computer to choose the "right" choice for winning the game. It should be able to make a decision based on not only the rules of the game but also the opponent's choice. As a result, how to handle different situations of the game is a new challenge as well as new knowledge for us.