Skip to content

A repository for learning Go and also building projects on it

Notifications You must be signed in to change notification settings

King-kin5/Learning-Go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Learning-Go

A repository for learning Go and also building projects on it

First projects a number guessing game Guess number file This program implements a simple number guessing game where the user tries to guess a randomly generated number within a specified range. The program provides feedback on each guess and congratulates the user upon a correct guess, indicating the number of attempts made. The game continues until the user correctly guesses the number. i learnt how to properly use Conditional Statements: The use of if, else if, and else statements for making decisions based on the user's input compared to the randomly generated secret number. Variable Declaration and Initialization: The use of var to declare variables (attempts and userGuess) and the short variable declaration := for concise variable declaration and initialization. Error Handling: The use of error handling to manage unexpected situations, such as when the user enters non-integer input. Console Output: The use of fmt.Println to print messages to the console, providing information and feedback to the user. Loop Control (continue, break): The use of continue to skip the rest of the loop body and move on to the next iteration in case of invalid user input. The use of break to exit the loop when the correct guess is made. Overall Game Flow

About

A repository for learning Go and also building projects on it

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages