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
0
votes
0answers
31 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
2k 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
70 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
45 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
185 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
144 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
77 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
168 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
74 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
447 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
117 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
58 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
129 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
272 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
1k 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
138 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
808 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
1k 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
282 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
261 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
864 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
603 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
119 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
69 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
335 views

Simple guessing game in Haskell

Here is a simple Guessing Game I implemented in Haskell ...
2
votes
1answer
287 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
246 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
80 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
93 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
2k 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
1k 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
467 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
966 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. ...
2
votes
1answer
305 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
350 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
206 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
473 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
779 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
309 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
192 views

Guessing game - Is it a 40?

User has number in head, the program must guess the number. ...
3
votes
3answers
630 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
193 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
310 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? ...