First, OnlineGDB runs on all the platforms I know, so you can just create a guessing game, and it'd run on linux.
Next, what language do you want to write the program in?
In any case, you'd have to do a bunch of Google searches for random number generators, inputs and outputs, loops, comparisons, and other programming basics.