6 ms·
I haven't done this myself (not enough experience) but I saw a similar idea discussed years ago - for an experienced programmer learning a new language, reimple
by billswift 16y ago
I haven't done this myself (not enough experience) but I saw a similar idea discussed years ago - for an experienced programmer learning a new language, reimplement something you have already written in the new language. Supposedly, the fact that you had written the first application shows that you understand the problem domain, so you can concentrate on the new language.
- jacobolus 16y agoNot enough experience to make a tic-tac-toe game? No time like the present to try!
- nkassis 16y agoYup, just try it, make the board and how to check if someone won or if it's full, figure out how to get input from the user. Then if you like the language move to implementing a simple ai (start with randomly putting pieces ;p). By then you should know a good chunk (IO, loops, built in data structures ...)
- billswift 16y agoI have never done any graphics at all. All I know is bash and some awk and perl, mostly for text processing. I keep planning to learn more, which is why I read about it a bit, and browse HN, but I have too many other things I want to do too.
- bmelton 16y agoWho says you need graphics? o | o | o ---------- x | x | x ---------- o | o | o That (if HN doesn't mangle it) should be a fully working Tic-Tac-Toe board. You can store it as a string, hashtable, whatever you want. You could label the squares 1-9 for the prompt asking the user where to move. This is all doable with perl and a command line. Try it out, see what you learn.
- bmelton 16y agoHN mangled it, but I think you can see where the line breaks ought to go.
- spicyj 16y agoo | o | o --------- x | x | x --------- o | o | o
- nkassis 16y agoMy first implementation (in c++) was exactly like that. A 3x3 array that printed out like that. You had to enter 1,1 for the left upper corner (that's how I learned that arrays start at 0 in almost all languages ;p)
- Paulomus 16y agoYes, GNU Go, the premier open source Go program is implemented exactly like this. Any graphical front ends in use are all written by third parties.
- ido 16y agoIt's actually really easy to do simple 2d graphics, you can probably learn how to draw 2d rects/circles/etc on the screen in 10 minutes.
- deleted 16y ago[deleted]
- deleted 16y ago[deleted]