Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
0answers
58 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
101 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 ...
2
votes
2answers
68 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
147 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
111 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
53 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
87 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
181 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
629 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
114 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
671 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
906 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
262 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
1k 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
204 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. ...
4
votes
1answer
621 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
424 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 ...
1
vote
1answer
101 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
59 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
2k 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 ...
7
votes
2answers
221 views

Simple guessing game in Haskell

Here is a simple Guessing Game I implemented in Haskell ...
2
votes
1answer
242 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 ...
5
votes
1answer
191 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 ...
9
votes
7answers
2k 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
79 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
79 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 ...
2
votes
3answers
1k views

Number-guessing game in Java

I created a java number guessing game. I used some of the same code twice. I would like to know how to further simplify it if possible (I am a java beginner). ...
7
votes
2answers
914 views

Number guess game program in python 3

I started learning Python just yesterday, and so I am aware of my lack of knowledge regarding the language. Below is a program I wrote to simulate a guessing game. I ended up creating a lot of ad hoc ...
6
votes
2answers
372 views

Number-guessing game in Python with a single level of abstraction

I've read about keeping functions to the same level of abstraction, and it seems to make sense in all the examples. However, when translating to non-contrived programming, I'm still very unsure of my ...
3
votes
2answers
764 views

“Choose a number between 0-9” game

This is a simple "Choose a number between 0-9" Game. It works perfectly but I'd like to know if there's a way to make my code smaller with the exact same functionality. ...
3
votes
1answer
244 views

Guess a number between 1 and 100 (revision 1)

I have taken the critiques from the original post and tried to refactor. I used int.TryParse and that cleaned up quite nicely. What can I further improve on? Edit: (Guess a number between 1 and 100 (...
7
votes
2answers
3k views

Guess a number between 1 and 100

This is my attempt at writing a guessing game. Where can I improve my code to make it more succinct? Link to Revision 1 (Guess a number between 1 and 100 (revision 1)) ...
0
votes
1answer
268 views

Simulated arcade with a slot machine and number-guessing game

I am creating an arcade type thing in Python. Could someone suggest ways to simplify this code, or any other tips? All help is much appreciated. I think the ...
11
votes
3answers
2k views

“Guess the number Game” in C

Just started learning C. I hope my code adheres to best practices and idioms ...
5
votes
1answer
170 views

Semi-complex Guess My Number

Please understand my request before commenting, I'm looking for positive critiques of my work. Anything I've done which could be done better while using the same, or similar, restrictions on data ...
4
votes
1answer
422 views

Guess number with lower or higher hints

Problem statement Two players - Alice and Bob. Alice needs to guess a number \$n\$, from range \$[1, N]\$, \$N \le 200\$ In \$i\$th turn, Alice guesses a number \$i\$ Bob chooses to ...
6
votes
2answers
597 views

“Number guessing game” in Python

I am new to Python and I have tried to come up with a code for the number guessing game. But I am pretty sure this is not the right way to do it. I am able to get the right output, however, my code is ...
15
votes
2answers
1k views

Program that guesses your number using bitwise operations

I got the idea for this program from this site. functions.cpp: ...
0
votes
1answer
242 views

Guessing game for a five-digit code

In this program, there is a code that the user has to try to solve in 10 guesses. If you have any numbers in the right spot, it will tell you how many you have correct and the value of the correct ...
3
votes
2answers
83 views

Printing blocks in guessing game

I wrote a guessing game and I want it to be reduced because there are a lot of if statements basically handling the same task with a minor difference. Is there an ...
4
votes
1answer
190 views

Guessing game - Is it a 40?

User has number in head, the program must guess the number. ...
4
votes
3answers
541 views

Guess three random numbers in order

We were given a homework assignment to create a C++ program that generates 3 different random numbers each time and the user is supposed to guess the three of them AND in order. I already achieved ...
0
votes
1answer
179 views

Guessing a random number [closed]

The program asks for a user to set the max number of the range. That number is used to set the max range of a randomly generated number. The program keeps track of the number of guesses. I have taken ...
1
vote
2answers
283 views

One-shot number guessing game

This program is one of the exercises I solved in my book. Can anyone suggest any improvements to it? ...
4
votes
1answer
164 views

Simple text based game (LPTHW)

For Learn Python The Hard Way exercise 45 I made a small text game, that took a few hours. Since classes were used and classes were a recently brought up concept in the book, I was wondering how this ...
7
votes
2answers
1k views

Beginning Python guessing game

I am new to Python (and coding in general) and after about a week of reading "Thinking Like a Computer Scientist: Learning with Python" I decided to try and build a version the classic "guessing game"....
4
votes
2answers
883 views

Number Guessing Game in Haskell

I've been learning a lot about functional programming lately and I've recently started learning Haskell to which I'm very new. I've written a simple number guessing game and I would like to have ...
2
votes
1answer
118 views

Rust cows and bulls

I just wrote a cows and bulls implementation in Rust. It seems a little large. Are there any changes I could make while still keeping it easily readable? ...
4
votes
1answer
276 views

Guessing game in Java - Take 3

I already have two versions of this code reviewed (thanks @Bobby). They can be found here and here. The question is still the same. The goal is maintainability and following best practices. Jar....
2
votes
2answers
6k views

Hi-Lo guessing game with numbers

I am new to Java in general, but wanted to get some input on the code for a CS class I am taking. It is a program that plays the Hi-Lo guessing game with numbers. A user may choose to quit mid-game ...