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
4
votes
1answer
35 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 ...
5
votes
3answers
277 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
61 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: ...
3
votes
3answers
137 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, ...
2
votes
2answers
79 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
151 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
0answers
57 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
91 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
57 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
668 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
395 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
85 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
399 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
84 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
1k 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
125 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
61 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
271 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
410 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
2k 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
176 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
323 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
316 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
1k 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
935 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
137 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
92 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
3k 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
491 views

Simple guessing game in Haskell

Here is a simple Guessing Game I implemented in Haskell ...
2
votes
1answer
322 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
392 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
111 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
4k 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
667 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
1k 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
458 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
440 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
3k views

“Guess the number Game” in C

Just started learning C. I hope my code adheres to best practices and idioms ...
5
votes
1answer
242 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
523 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
962 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 ...