online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
package main import ( "fmt" "math/rand" "time" ) func main() { secret := getRandomNumber() fmt.Println(secret) fmt.Println("Guess the number") var _guess int for i := 3; i > 0; i-- { _guess = guessRandomNumber() if _guess == secret { fmt.Println("You guessed it!") break } else if _guess < secret { fmt.Println("Too low") fmt.Println("You have", i-1, "guesses left.") } else { fmt.Println("Too high") fmt.Println("You have", i-1, "guesses left.") } if i != 1 { fmt.Println("Guess Again:") } } } func getRandomNumber() int { rand.Seed(time.Now().UnixNano()) return rand.Int() % 11 } func guessRandomNumber() int { var guess int //fmt.Println("Guess Number:") fmt.Scanf("%d", &guess) return guess }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue