Then i'd suggest you do try the rock-paper-scissors one. It can be just text input and some randomization, and a simple number comparison to see which one wins (with wrap around handling).
Perhaps extend it to rock paper scissors lizard spock after you've done that. You'll need a more involved who-wins approach for that one.
If you've made a working calculator, you should be able to manage that. Take it step by step, cut down the problems to bite size, and don't hesitate to ask for guidance if you get stuck. And most of all, don't blame yourself if you don't succeed right away. Learning takes time.
That's alright. It's going to be a fact of life in programming. I've been making software for almost two decades now and things still take longer than I thought.
I saw you did a guess the numbers game as well. Try one of the other suggestions you found. Think about how you would do it if you were to perform the actions yourself first, then try to capture it in code, or even an intermediate pseudocode before actually writing code.
Did you follow a step-by-step tutorial or did you actually write the code yourself? Problem solving is the most important skill in programming. If you really want to get good practice, don’t follow tutorials; come up with solutions on your own, even if you’re reinventing the wheel.
“Rock, paper, scissors” should be fairly straightforward for a beginner to implement. Use a whiteboard, pen and paper, notepad, whatever you need to visualize the problem and then work towards a solution. Use the internet for language issues only. Do not look for answers that have anything to do with “rock, paper, scissors”. Do not use AI. No skill is gained instantaneously. It takes struggle and practice.
My friend made this simple "game" a while ago and I've taken to really liking it as an beginner-tier exercise. It's called "bavis simulator". The program flow is as follows:
The user is prompted to enter the word "bavis"
Once the user has entered something, the program compares their input against the string "bavis"
If the string matches, the "bavis counter" is incremented, and shown to the player. Otherwise, the player loses the game, and the program terminates
If the player has not lost, goto step 1
This is a stupidly simple premise, but I reckon it's a nice exercise for beginners, since you can expand on it. Once you've made the above program, try adding the following extensions:
Multiple lives - allowing the player leniency if they type something wrong
A shop system - allow a special command "shop" which you can enter instead of "bavis", and make some way for the player to buy multipliers. Now, with multipliers, they will gain 2 or 3 bavises for every "bavis" entered, instead of just one
A time counter - time how long it takes for the player to reach 10'000 bavises, and terminate the game at that point, and display the time. This could be the win condition
It's a stupid little game but honestly I think that for a total beginner it has value since it will teach you about I/O, loops, conditional checks, system time checking, tracking state between game loops, etc.
I would go the other tunnel. Find a way to linearize the polynomial, then create a whole new compiler for it xD with its grammar and virtual machine, only for basic polynomial division.
Just keep in mind that a complex project is just a bunch of simple projects that all work together. Write down a list of things that you'll have to do to make something like tictactoe work. Two players take turns, 9 possible moves with each being either an x or an o, which is determined by what player's turn it is. 8 possible winning conditions.
Just take that list and think about how the logic for that might work. Where might you need a loop, where might you need to embed some pre-made data? How might you print the board?
17
u/Illustrious-Wrap8568 Mar 29 '24
Start with a program that asks for two numbers on the command line and outputs the result of adding them together.
Teaches you handling input, output and some basic math operations.
Then expand that to a calculator that takes the two numbers and allows you to pick an operator.
12
u/polytopelover Mar 29 '24
My friend made this simple "game" a while ago and I've taken to really liking it as an beginner-tier exercise. It's called "bavis simulator". The program flow is as follows:
This is a stupidly simple premise, but I reckon it's a nice exercise for beginners, since you can expand on it. Once you've made the above program, try adding the following extensions:
It's a stupid little game but honestly I think that for a total beginner it has value since it will teach you about I/O, loops, conditional checks, system time checking, tracking state between game loops, etc.
5
u/Abigboi_ Mar 29 '24
You mentioned a calculator you made, how about a program that does polynomial long division?
3
u/xhitcramp Mar 29 '24
Code Newton’s method
3
u/poopy_poophead Mar 29 '24
Just keep in mind that a complex project is just a bunch of simple projects that all work together. Write down a list of things that you'll have to do to make something like tictactoe work. Two players take turns, 9 possible moves with each being either an x or an o, which is determined by what player's turn it is. 8 possible winning conditions.
Just take that list and think about how the logic for that might work. Where might you need a loop, where might you need to embed some pre-made data? How might you print the board?
Tic tac toe is a really good starter project.
3
u/itsEroen Mar 29 '24
A guess-the-number game that tells you if your guess it's too high or to o low.
3
u/[deleted] Mar 29 '24
https://projectbook.code.brettchalupa.com/
2
u/fliguana Mar 30 '24
Reverse a text file. Can keep you busy for months, looking for all cases.