Guessing game

Programming a guessing game

Creating project

Firstly we need to setup or project

$ touch game.jazz
$ youreditor game.jazz

Writing code

The first part of the guessing game program will ask for user input, process that input, and check that the input is in the expected form. To start, we’ll allow the player to input a guess.

println("Guess the number!")
println("Please input your guess")
let input = read_line()
println("You guess: ",input)

println is a function that prints string to the screen

read_line reads string from keyboard input ended by new line

Testing the First part

Let's try to run this thing:

$ jazz game.jazz
Guess the number!
Please input your guess
You guessed: 2