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.
186
questions
4
votes
2
answers
848
views
Identifying unnecessary attributes in a Python class?
I have commented out two attributes (in random_number_guesser.py) which I believe are unnecessary.
Am I correct in assuming that, because the code runs correctly without their implementation, they ...
5
votes
1
answer
121
views
RNG Minigame In Python - Best Practices & Possible Improvements?
Recently, I got into programming with Python as a fun little side hobby. After watching a bunch of YouTube tutorials (to learn about IDE's, variables, etc.), I finally got to the point where I was ...
8
votes
2
answers
1k
views
Number guessing game for x86
I'm new to assembly and I've just finished this guessing game that I wanted to make to improve my skills in this language. It runs in a Unix environment and does the following:
generates a random ...
3
votes
2
answers
543
views
New York Times' Digits Game Solver
I wrote an algorithm to solve the New York Times' Puzzle: Digits.
You could play the game here.
The rules of the game are as follow:
You were given 6 numbers and you could use simple operations (plus, ...
6
votes
3
answers
1k
views
3
votes
1
answer
101
views
End to End testing of user interaction in Rust
I am interested in any kind of possible improvement to this method of testing a Rust program with user interaction in an end-to-end manner (simulating user input and asserting a certain program output ...
4
votes
1
answer
99
views
number-guessing game - 1 through 30
I created this python number-guessing game and I have two concerns with it. The code works as intended with no flaws; however, I'm not too fond of the way I wrote it. It is messy, unorganized, and all ...
6
votes
1
answer
129
views
Bagels (based on big book of python) in c++
I just learned programming and decided to copy projects in big book of python but in c++ and completed the first project. I would like to know your opinions and how can it be improved! Thanks in ...
5
votes
2
answers
1k
views
Number guessing game with difficulties and highscore
I'm sure you've heard this before, I'm a beginner, however I'm trying to break out of the basics and use more intermediate things like functions and such but I'm having a hard time understanding how ...
6
votes
4
answers
2k
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 ...
4
votes
2
answers
353
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 ...
6
votes
2
answers
810
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 ...
2
votes
0
answers
612
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 ...
2
votes
2
answers
154
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.
...
-1
votes
1
answer
98
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 ...
7
votes
2
answers
575
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 ...
1
vote
1
answer
187
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 ...
3
votes
2
answers
365
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 ...
5
votes
2
answers
1k
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 ...
2
votes
2
answers
1k
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 ...
3
votes
1
answer
123
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)....
4
votes
2
answers
1k
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, ...
1
vote
1
answer
243
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 ...
2
votes
2
answers
189
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?
...
5
votes
2
answers
810
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
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.
...
3
votes
1
answer
89
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 ...
3
votes
1
answer
145
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 ...
2
votes
1
answer
372
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
2
answers
144
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 ...
4
votes
2
answers
3k
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
3
answers
3k
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 ...
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.
...
7
votes
2
answers
548
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
2
answers
190
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
2
answers
196
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:...
2
votes
1
answer
256
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
1
answer
90
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
3
answers
440
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 ...
1
vote
1
answer
211
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
3
answers
543
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
2
answers
92
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
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 ...
4
votes
3
answers
975
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
2
answers
755
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
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 ...
2
votes
1
answer
161
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
1
answer
77
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
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....
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 ...