Under construction

Still being built. Things may change

Ninety-nine

Time limit1sMemory limit1024 MB

Summary
Two players take turns adding 1 or 2 to a running count that starts at 1 or 2, and the task is to write a program that picks the start and moves so you say 99 first.
Level

Easy3 of 10

Topics
Game theory, Math
Solved
No attempts yet

Problem

You and your friend are playing a game that you call Ninety-nine. You start by saying either the number 1 or 2. Then you take turns, starting with your friend, increasing this number by either 1 or 2 in each step. The first player to say the number 99 wins!

Write a program that plays this game for you and wins.

Examples1

  1. Example 1

    Input
    1
    
    Expected output
    3