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
6 votes
4 answers
891 views

Guessing the Number Game

I started my python journey 4 days ago. I am following a Youtube tutorial currently to understand the basics of Python. So bear in mind that I am REALLY new to this. I wanted to test myself a little ...
user avatar
  • 333
4 votes
2 answers
258 views

Another number-guessing game

I am a newbie in Python and would very much need help in arranging and setting out function. I have programmed a number guessing game. The outlook of the program is very messy but I don't where to fix ...
user avatar
  • 41
6 votes
2 answers
562 views

Simple number-guessing game in Haskell

I've been learning Haskell for 2 weeks now which is I'm very new to it. I would like to have feedback on what is good/bad about my code and how it could I improve in learning functional programming ...
user avatar
  • 63
2 votes
0 answers
95 views

Cows and bulls game in JavaScript

I've been working on this game the last 2 days. The game is working but I need a feedback for my code. Can it be made simpler? Sorry if my code is very complicated or not well written: I am in the ...
user avatar
2 votes
2 answers
89 views

Console guessing game in Python

What would make it better? This is my first Python project. Do help in making it better, for me to learn something new. ...
user avatar
-1 votes
1 answer
32 views

Is there a better way of creating this small guessing game in PowerShell? [closed]

I have a guessing game in PowerShell trying to practice the while statement. I found this on the internet on someone's repo. I have a feeling it can be shortened but maybe I am wrong. This is pure for ...
user avatar
  • 15
7 votes
2 answers
106 views

First JavaScript project: number guessing game

I wanted to share my first experience with JavaScript. I've been taking JS courses for the past 2 months and finally got the first chance to code a small guess-my-number project. (Everything is ...
user avatar
  • 71
1 vote
1 answer
65 views

Console-based number guessing game

I received feedback that my code was convoluted and written with very bad practices. Our tutor said explicitly that I should never write the code like that. I'm just trying to wrap my head around the ...
user avatar
  • 11
3 votes
2 answers
139 views

Python random number guessing game

I've been learning Python for about 4 days now. Python is my first programming language, so I'm not that good at coding yet. I have been programming a little random number game as my first project and ...
user avatar
5 votes
2 answers
599 views

Guessing game - Too high. Too low

I will post 2 scripts that are doing (supposedly) the same thing. First one is the script i created, second one is the solution from the course. What would you consider wrong (if anything) with the ...
user avatar
  • 59
2 votes
2 answers
133 views

Simple Number guessing game

The question is: Write a C++ program to play a simple number guessing game against a computer opponent. The rules of the games are as follows: The computer randomly selects a secret number between ...
user avatar
3 votes
1 answer
82 views

Number Guessing Game Version 1

I made a really basic number guessing game based off a list of recommended projects, and i want to see if it follows the normal coding conventions before I aim to improve it(with lives, or hints, ect)....
user avatar
4 votes
2 answers
258 views

Higher lower game

I'm currently learning python with an udemy course. I wrote this code, which is meant to be a higher lower game, where the second answer always stays. As far as i tested it my code is working fine, ...
user avatar
1 vote
1 answer
115 views

Guess The Number Game with GUI

So I've decided to practice I will turn all my scripts etc into GUI apps. So my 36 loc guess the number game turned into 136 loc. It's not the best looking, but it does work and on hard it's actually ...
user avatar
  • 456
2 votes
2 answers
89 views

Number guessing game in Ruby

I am a newbie in Ruby. I want to learn Ruby and I want to learn clear code in Ruby. I coded a number guessing game but my code is smelling bad. How I can do better code? ...
user avatar
5 votes
2 answers
347 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&...
user avatar
  • 53
12 votes
3 answers
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. ...
user avatar
  • 123
3 votes
1 answer
79 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 ...
user avatar
  • 63
4 votes
1 answer
95 views

Binary guess game in C++

This is a program in C++ that guesses a number given by the user. I have to do homework and there's my attempt to solve an exercise from the programming book. If you know what can be done better and ...
user avatar
2 votes
1 answer
211 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 ...
user avatar
  • 21
4 votes
2 answers
130 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 ...
user avatar
4 votes
2 answers
2k 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 ...
user avatar
  • 802
15 votes
3 answers
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 ...
user avatar
5 votes
1 answer
2k views

Number-guessing game based on Rust tutorial

This is how I implemented the guessing game - chapter 2 of the Rust book. ...
user avatar
  • 1,101
7 votes
2 answers
513 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 ...
user avatar
5 votes
2 answers
155 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))...
user avatar
3 votes
2 answers
184 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:...
user avatar
2 votes
1 answer
194 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 ...
user avatar
  • 21
4 votes
1 answer
58 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 ...
user avatar
  • 1,714
6 votes
3 answers
412 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 ...
user avatar
2 votes
1 answer
80 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: ...
user avatar
  • 23
4 votes
3 answers
459 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 ...
user avatar
2 votes
2 answers
85 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. ...
user avatar
  • 165
13 votes
3 answers
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 ...
user avatar
4 votes
3 answers
738 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? ...
user avatar
  • 2,006
0 votes
2 answers
462 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. ...
user avatar
9 votes
5 answers
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 ...
user avatar
  • 359
2 votes
1 answer
128 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. ...
user avatar
2 votes
1 answer
69 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] ...
user avatar
5 votes
2 answers
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....
user avatar
  • 53
3 votes
2 answers
1k 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 ...
user avatar
2 votes
0 answers
120 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 ...
user avatar
  • 195
4 votes
2 answers
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 ...
user avatar
4 votes
2 answers
93 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 ...
user avatar
2 votes
2 answers
4k 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 ...
user avatar
1 vote
1 answer
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? ...
user avatar
3 votes
1 answer
81 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 ...
user avatar
  • 1,960
1 vote
1 answer
805 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! ...
user avatar
  • 2,897
2 votes
3 answers
780 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 ...
user avatar
4 votes
1 answer
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. ...
user avatar
  • 43