0

A nice challenge for using OOP?

I have just begun with using Python, and after this week I will have done a lot of beginner challenges to learn the programming code. I found the Ptyhon OOP and FOP very difficult in the lessons on Sololearn. Does anyone of you guy know a nice challange that can help me learn this way of programming? Thanks in advance!

24th Aug 2018, 1:42 PM
Wouter Steendam
Wouter Steendam - avatar
4 odpowiedzi
+ 2
what is FOP
24th Aug 2018, 5:16 PM
Maninder $ingh
Maninder $ingh - avatar
+ 1
In my opinion, making a game of some sort that involve actual 'objects' that you can interact with might be a good way to get the hang of OOP. It's also very rewarding to make something you can see working. -------------------- You can make use of Python's pygame library to make simple games. But you should consider Processing, which does require a download, but is much more beginner friendly and fun to learn (in my opinion at least) https://py.processing.org/ -------------------- Maybe you could start off with a tic tac toe game. It might include a 'Board' object, with methods and properties such as: - board.data - board.mark([mouseX, mouseY], 'X') - board.isGameOver() - board.reset() Or a pong game with Paddle and Ball objects: - pad1.move(10) - ball.isHitting(pad1) - pad2.score += 1 Maybe even a snake game - snake.dead() - snake.length += 1 - food.isEaten() You get the idea, maybe you could even make your own game. -------------------- Here are some examples (for inspiration, definitely not self promotion) https://justaratherridiculouslylongusername.github.io/Snake/ https://justaratherridiculouslylongusername.github.io/Pong/ In case you run out of ideas http://inventwithpython.com/blog/2012/02/20/i-need-practice-programming-49-ideas-for-game-clones-to-code/ -------------------- Hope this was of some help :)
24th Aug 2018, 2:32 PM
Just A Rather Ridiculously Long Username
0
thanks man! I'll get right on it!
24th Aug 2018, 2:37 PM
Wouter Steendam
Wouter Steendam - avatar
0
No problem! Let me know if I can be of any more help
24th Aug 2018, 2:44 PM
Just A Rather Ridiculously Long Username