Questions tagged [number-guessing-game]

This tag is used when the program's purpose is to guess a number of your choosing or have you guess a number of the program's choosing.

Filter by
Sorted by
Tagged with
5
votes
2answers
108 views

Simple number guessing game in python

The problem is to ask the user to guess a number between 1 to 100 and compare it with a random number of that range. If user guessed number is lesser/greater than the random number print "too low&...
12
votes
3answers
2k views

“Guess the Number” in C

This is my first program in C. Do you have any improvements to this program? The program allows you to guess a number and also returns the attempts. ...
3
votes
1answer
63 views

Random number generator [Beginner]

I'm learning Python and I'm building a basic random numbr generator. The code below works as expected. I'm just wondering if it uses best practice / can be made better. Some future considerations ...
2
votes
1answer
62 views

Guess Number Game - Console based game using Java

This game is pretty common for beginner projects. I wrote a version of this before all in Main - so here I challenge myself to recreate it in a more OO style. I wanted to take a more OO approach, so ...
4
votes
2answers
118 views

python Guess The Number

This is my take on the guess the number game. The user has three attempts to guess the number chosen at random. The number is between 0 and 9, including. It tells the user to guess higher or lower and ...
5
votes
2answers
741 views

Higher or Lower guessing game

After an extended absence from coding, I decided I would make something to try and get back on my feet again. I ended up making a project that I have made several times before, a higher-lower guessing ...
15
votes
3answers
2k views

C++ Number Guessing Game

I created a simple guessing game where the player can choose whether the player is guessing the number or the computer. If the player is guessing the number, then the computer will generate a random ...
7
votes
3answers
485 views

Beginner's Number Guessing Game

I've started learning to program, and as the first program I wrote on my own I wanted to come up with a number guessing game - the below is what I got. I'm mainly looking for a review of my ...
5
votes
2answers
144 views

Guess the Number In C++

Mind that this is my first actual program in C++ and I tried to prepare for any possible input. Also the reason I included static_cast<void>(generator(range))...
3
votes
2answers
169 views

Console-based Guess the Number

I started learning Python and wrote my first program. This is a console game based on guessing the number. Can you take a look and tell me if I'm doing it right or give me any advice? Here is the code:...
3
votes
1answer
121 views

(Python) Random Number Guessing Game

I'm a beginner currently learning Python. I made a simple program, a random number guessing game, to apply in practice what I have already learned (not much) and hopefully be able to get a better ...
4
votes
1answer
43 views

Guess the number with a twist

I wrote a program where the computer guesses a random number. To do this, I implemented a form of binary search. This correctly handles any edge-cases that I know of, including ...
6
votes
3answers
384 views

Simple text based game in C

After sticking with the same handful of languages for years, I decided to learn C. I've written a guess the number game, where it generates a random number based on the difficulty level, and then you ...
2
votes
1answer
75 views

Number guessing game with statistics

I am new to programming, and I wanted to ask, is my code inefficient / poorly written? Here is my code below for an exercise I just did. The point is for the user to guess the number 0, but it also: ...
4
votes
3answers
381 views

Codeabbey Code Guesser

I was doing this exercise on codeabbey. Andrew and Peter play the code-guessing game. Andrew chooses a secret number consisting of 3 digits. Peter tries to guess it, proposing several values, one by ...
2
votes
2answers
83 views

Just a simple guessing game

This is a simple guessing game I have made, an improvised one. I will do a GUI version of this shortly. I'm looking for comments and interesting code ideas. ...
13
votes
3answers
2k views

Python reimplementation of Lost In Space by Tim Hartnell

In a university library, there was copy of "Making The Most Of Your ZX 81" by Tim Hartnell. I flipped to an interesting page from the index and found this program in BASIC, and thought it interesting ...
4
votes
3answers
327 views

Number Guessing Game in Java

This is my implementation of the famous Number Guessing Game. It is not object oriented, but the goal was to create a simple to read, procedural program. Have I accomplished this goal? ...
0
votes
1answer
226 views

Random-number-guessing game as a batch script

I made a little gambling batch file and wanted to know if there was a better way to do the randomization and the checker. ...
9
votes
5answers
3k views

Java guess the number

I have just returned to college to finish my associate's in programming. The language my school uses for all of the programming classes is java, so I've been trying to get used to the language. The ...
2
votes
1answer
112 views

Number guessing game in Python

I'm learning python and created a number guessing game on which I would like to get your feedback on the structure and style of the program. ...
2
votes
1answer
66 views

Guess the Number(Python)

I know this is kind of stuff is somewhat done to death but please still try to review it fairly. My code will only go within the interval of [1,9] ...
5
votes
2answers
1k views

Guess the number game (Python)

I'm very new to coding and decided to try a mini-project in python to create a 'guess the number game'. I was just hoping for some feedback on my code-writing to prevent bad habits before they develop....
3
votes
2answers
825 views

Number guessing game in C

This is just a little number guessing game. I know it's simple but I am a newbie in C and I think such a little example can be enough for finding simple design flaws that can than be eliminated. If ...
1
vote
0answers
101 views

Java Swing “guess my number” game in Hexagonal architecture

Based on this article, I wrote a small "Guess my number" game in Hexagonal architecture which interacts with a Java Swing GUI adapter. Any feedback is appreciated. Main.java ...
4
votes
2answers
2k views

Guess-the-number game by a Python beginner

For some background I'm pretty much a beginner and attempting to learn Python currently. So I decided after a few days of lessons I'd look for some beginner projects to test my knowledge. A website ...
4
votes
2answers
87 views

Program guessing a random number

I began trying to learn python3 as my first programming language two days ago for a hobby and interest to teach my kids later on. I've been working on a program guessing a random number. I started ...
2
votes
2answers
3k views

Number-guessing game using functions

First time writing a "game" in a sense. Used a functions approach, it's simple, looking for a review of the way it's written and of course looking for how should it be written. Also using random for ...
1
vote
1answer
127 views

NumberGuessGame

I've already posted a first attempt on Code review. Here is a new version that takes into account the answers I've received. Is my program now reasonable or are there still things I need to improve? ...
3
votes
1answer
65 views

Guess that number, Larger or Smaller?

I created a simple guessing game for the sake of practice, it's been a while since I've had any code reviewed. I do have a tendency to over-engineer things sometimes and I'm not typically aware of it ...
1
vote
1answer
579 views

Guessing game in NASM Win64 Assembly

Still learning Assembly. This program is a simple guessing game to test most of the new things I've learned! Any advice and all topical comments on code optimization and conventions is appreciated! ...
2
votes
3answers
705 views

Simple random number guessing game with various difficulties

I have been studying C#, and I am trying to model the Random number guessing game. 1 User inputs the number of try. 2 Computer generates random number. 3 If numbers doesn't match user lose one try ...
4
votes
1answer
3k views

'Guess the Number' game in Python 3

I am new to learning code, and would love some feedback on how this little game could be improved and/or tidied up. ...
3
votes
1answer
244 views

Java Console Guess The Number Game

I was given a homework assignment to code a console Guess the Number Game, where the user should guess a random number. Also, I had to code a simple menu with switch where I can change a random number ...
10
votes
3answers
1k views

Guess the number game using jupyter notebook

I made a number guessing game in Python 3 using jupyter notebook. I would appreciate it a lot if I could get some feedback on my code. ...
6
votes
2answers
2k views

Number guessing game learncpp.com challenge C++

Challenge This is my first 'big' project in C++. (Another number-guessing game, yay!) It's a slightly modified version of the learncpp.com quiz I set as a challenge for myself. The original challenge ...
2
votes
2answers
343 views

Simple random number-guessing game

I am so new to programming. Trying to learn as I go. I made a very simple "Guess the number" game. Just wanted to get some critiques, see if I could clean it up or change anything. ...
7
votes
2answers
2k views

C++ number-guessing game (computer tries to guess user's chosen number)

In this program we input a number. Our PC tries to guess this number. After every try PC asks us:"Are your number more or less than?". We input 'l' if our number is less, and input 'h' if our number ...
1
vote
3answers
356 views

Random number guessing game 456

This code is working well, I am just fairly new to programming and am hoping someone more experienced can look it over and give me some pointers. ...
5
votes
2answers
3k views

Guess user number between 0 and 100 (Binary Search)

I am at the beginning of learning python and one of my homeworks (in chapter regarding loops) where to write a code that would guess user number between 1 - 100. I believe I used algorithm called ...
1
vote
2answers
1k views

Number-guessing game, for numbers between 0 and 99

I have written a complex number guess game. The output should be like this: Enter initial guess between 0 and 99: 45 Initial guess is 45 45 is too high. Make a guess between 0 and 45 10 10 is too ...
1
vote
1answer
160 views

“Guess number” game Java Swing app

I have implemented a "Guess number game" using Swing. The idea is that the user enters a range and the program makes guesses of the number. This is the first time I'm implementing this kind of ...
2
votes
1answer
136 views

Number Guessing Game in C++ without global varibles

Recently, I have gotten into C++. My past experience is some batch programming and beginner JavaScript/HTML. This language, unlike the others, has made me really think about the efficiency of my code. ...
3
votes
1answer
4k views

Guess number game with an object-oriented design

I want to write well-thought-out, professional, object-oriented code. I wrote this little game to practice this. My goal was to find out how to dissect a number guessing game object-oriented. In the ...
9
votes
2answers
719 views

Simple guessing game in Haskell

Here is a simple Guessing Game I implemented in Haskell ...
3
votes
1answer
368 views

C++ beginner exercises: bracketing search

After receiving feedback for the grading exercise from this list I proceeded to the next one that looked interesting to me, namely implementing the bracketing search for a computer to guess a number ...
4
votes
1answer
798 views

Number-guessing game in Kotlin

I am a Java developer, and I recently gave Kotlin a try. To begin, I did a little exercise I often do when I start a new language, to verify I got the very basics: the more or less game. The code I ...
10
votes
7answers
3k views

Guess the computer's number using functions

I am looking to improve the Python Number Guessing Game program: How is the overall structure of the code? Have I used functions to the best of their ability? Can the code be simplified? If yes, ...
1
vote
1answer
81 views

A simple program using branching to guess the answer

As a rookie to programming, i'm really excited about finishing my first program. But I know I only learn by making mistakes and through constructive criticism. I'm open to any feedback regarding my ...
5
votes
1answer
123 views

Swing “Number Guesser” program

I have made a UI that guesses the number that the user is thinking of(0 - 100), and I am wondering if it can be improved(I guess this is simple AI). I tried to shorten it as best I could, but it still ...