I lost interest in programming after I realized how much effort it would take me to do anything cool.
For those people here who consider themselves reasonably skilled at programming: how long would it take you to implement a clone of Tetris? I’ve got a computer engineering degree, and “cin” was the only user input method they taught me in programming classes...
Edit: You’re not allowed to use ASCII graphics, and it has to run at the same speed on different processors, but other than that, requirements are flexible.
Depends on how many bells and whistles you want. For just a basic clone, I can do it in an evening, using a third-party library to handle the windowing and whatnot. Of course if you wanted to implement the windowing and input handling by talking directly to the OS, it would be an utter nightmare; call it three months.
User experience makes questions like this tricky: graphics, sound, score-tracking, tightening up controls. If I was working with a graphics library I was already familiar with, I doubt the core gameplay would take me more than a few hours. Writing a reasonable clone of the version of Tetris I played fifteen years ago on the Atari ST would take at least a couple of weeks, though, and that’s if I had all the resources I needed on hand. An exact clone would take even longer.
A related question: how much would a beginner have to study before being able to write Tetris? As I said, I graduated with a degree in computer engineering without being able to code Tetris, because I have no idea how to write anything except console programs that use cin and cout to do all the input/output work. “Draw something on the screen, and have it move when someone presses a key” would seem to be a fundamental task in computer programming, but apparently it’s some kind of super-advanced topic. :P
The focus on cin / cout as opposed to GUI is probably because cin is simple and always works the same way (mostly because nobody uses it, no need for a zillion libraries), whereas there are a lot of very different GUI libraries with different ways of doing things; learning one of those would take time and not help you use another one much.
If you want to learn yow to make a GUI you can probably find a “hello world” example for your language/os of choice and just copy-paste the code and then adjust it to suit your needs.
It’s not as hard as it might sound. Modern languages have nice libraries and frameworks that make input and basic graphics very easy. Here’s a tutorial for Slick (a Java-based 2D game framework) that walks you through how to do exactly what you ask:
http://slick.cokeandcode.com/wiki/doku.php?id=01_-_a_basic_slick_game
Probably not too long. I wrote (a crappy version of) Breakout in my second semester of high-school programming, and that was using Pascal plus some homebrewed x86 assembler for the graphics (both of which were a nightmare that I wouldn’t recommend to anyone), so simple games clearly don’t require any deep knowledge of the discipline; if you’ve got a computer-engineering background already and you’re working with a modern graphics library, I’d call it a couple weeks of casual study. Less if you’re using a game-specific framework, but those skills don’t usually transfer well to other things.
I did this (in Java) when I had some spare time at work recently. It took a couple of days of work (with some slacking off), including learning a (pretty simple) new game/graphics framework.
An evening? Depends on what you mean by “Tetris” and the target quality. I did a two player Tetris-over-network for a class once (the opponent gets an additional garbled line when you clear multiple lines). It’s easy, which is part of the problem: with enough expertise, it can become boring, you don’t learn as much new stuff, it becomes more like laying bricks, not designing intricate machines or learning the principles of their operation.
An estimate that I heard on multiple occasions, disbelieved, and then witnessed come true, is that it takes about 4 years of hands-on experience for an enthusiastic smart adult to conquer the learning curve and as a result lose enthusiasm for software development in the abstract (so that you’d need something special about the purpose of the activity, not just the activity itself). I don’t know about the probability of this happening, but the timescale seems about right.
I wrote tetris for IBM-370/VM once, during school practice. The main problem was making the keyboard and display work in real time, had to write significant parts in assembler. Took about three weeks of evenings.
I lost interest in programming after I realized how much effort it would take me to do anything cool.
For those people here who consider themselves reasonably skilled at programming: how long would it take you to implement a clone of Tetris? I’ve got a computer engineering degree, and “cin” was the only user input method they taught me in programming classes...
Edit: You’re not allowed to use ASCII graphics, and it has to run at the same speed on different processors, but other than that, requirements are flexible.
Depends on how many bells and whistles you want. For just a basic clone, I can do it in an evening, using a third-party library to handle the windowing and whatnot. Of course if you wanted to implement the windowing and input handling by talking directly to the OS, it would be an utter nightmare; call it three months.
User experience makes questions like this tricky: graphics, sound, score-tracking, tightening up controls. If I was working with a graphics library I was already familiar with, I doubt the core gameplay would take me more than a few hours. Writing a reasonable clone of the version of Tetris I played fifteen years ago on the Atari ST would take at least a couple of weeks, though, and that’s if I had all the resources I needed on hand. An exact clone would take even longer.
A related question: how much would a beginner have to study before being able to write Tetris? As I said, I graduated with a degree in computer engineering without being able to code Tetris, because I have no idea how to write anything except console programs that use cin and cout to do all the input/output work. “Draw something on the screen, and have it move when someone presses a key” would seem to be a fundamental task in computer programming, but apparently it’s some kind of super-advanced topic. :P
The focus on cin / cout as opposed to GUI is probably because cin is simple and always works the same way (mostly because nobody uses it, no need for a zillion libraries), whereas there are a lot of very different GUI libraries with different ways of doing things; learning one of those would take time and not help you use another one much.
If you want to learn yow to make a GUI you can probably find a “hello world” example for your language/os of choice and just copy-paste the code and then adjust it to suit your needs.
Yeah… everything is in libraries these days and the libraries are all incompatible with each other. :(
It’s not as hard as it might sound. Modern languages have nice libraries and frameworks that make input and basic graphics very easy. Here’s a tutorial for Slick (a Java-based 2D game framework) that walks you through how to do exactly what you ask: http://slick.cokeandcode.com/wiki/doku.php?id=01_-_a_basic_slick_game
Here’s a tutorial for how to make Tetris: http://slick.cokeandcode.com/wiki/doku.php?id=02_-_slickblocks
I’m sure similar things exist for C++, especially since it’s the most popular language for making games in.
edit: If you want to actually follow one of the above tutorials, see this setup info first: http://slick.cokeandcode.com/wiki/doku.php?id=getting_started_and_setup
Probably not too long. I wrote (a crappy version of) Breakout in my second semester of high-school programming, and that was using Pascal plus some homebrewed x86 assembler for the graphics (both of which were a nightmare that I wouldn’t recommend to anyone), so simple games clearly don’t require any deep knowledge of the discipline; if you’ve got a computer-engineering background already and you’re working with a modern graphics library, I’d call it a couple weeks of casual study. Less if you’re using a game-specific framework, but those skills don’t usually transfer well to other things.
I did this (in Java) when I had some spare time at work recently. It took a couple of days of work (with some slacking off), including learning a (pretty simple) new game/graphics framework.
If you don’t care about graphics, like a couple hours. But you could spend as much time as you want on graphics.
Use Pygame. Evidence: People frequently produce playable games using Pygame in 24-hour hackathons.
An evening? Depends on what you mean by “Tetris” and the target quality. I did a two player Tetris-over-network for a class once (the opponent gets an additional garbled line when you clear multiple lines). It’s easy, which is part of the problem: with enough expertise, it can become boring, you don’t learn as much new stuff, it becomes more like laying bricks, not designing intricate machines or learning the principles of their operation.
An estimate that I heard on multiple occasions, disbelieved, and then witnessed come true, is that it takes about 4 years of hands-on experience for an enthusiastic smart adult to conquer the learning curve and as a result lose enthusiasm for software development in the abstract (so that you’d need something special about the purpose of the activity, not just the activity itself). I don’t know about the probability of this happening, but the timescale seems about right.