Live data from Hacker News

Show HN: 3D shooter in your terminal using raycasting in Awk

github.com

11–20 of 57 posts

Re: Show HN: 3D shooter in your terminal using raycasting in Awk

#11
post #7

This is hilarious. Is there any technical reason it couldn't have been written twenty years ago?

I guess 20 years ago CS students weren't told to "write a Doom-like game" as an awk homework =)

.....where do you go to school and how many credits can you transfer in with? :p

Re: Show HN: 3D shooter in your terminal using raycasting in Awk

#14
post #13

It's amazing what you can do in so few lines of code. If you have the time you ought to do a tutorial on how to make this sort of game, it would be a great read.

There is a great tutorial (it's actually a series of them) which I used: http://lodev.org/cgtutor/raycasting.html

It's old and C++ but explains raycasting very well.

And there is also a similar project in just 265 JS lines: http://www.playfuljs.com/a-first-person-engine-in-265-lines/

Re: Show HN: 3D shooter in your terminal using raycasting in Awk

#16

Like a sculpture made out of snot,you can applaud the elegance of the sculpture, and the elegance of the construction, but you have to wonder about the building material...

Ah but awk is great! It's parsimony when processing structured text files is hard to beat. Such a pity the next step on from it is perl. Perl is snot certainly.

Re: Show HN: 3D shooter in your terminal using raycasting in Awk

#19
post #17

Man, that AWK looks a helluva lot like Javascript.

As in Javascript, awk represents all numeric values using double precision floating point. I have always thought that was a strange (but not necessarily bad) choice for a language that is basically all about text processing. I guess it works out pretty well if you need to do 3D graphics math.

There is a bit of cheating going on here though. Awk doesn't support true multidimensional arrays. They are depending on a Gawk extension for that bit of functionality.

Re: Show HN: 3D shooter in your terminal using raycasting in Awk

#20
post #19
post #17

Man, that AWK looks a helluva lot like Javascript.

As in Javascript, awk represents all numeric values using double precision floating point. I have always thought that was a strange (but not necessarily bad) choice for a language that is basically all about text processing. I guess it works out pretty well if you need to do 3D graphics math. There is a bit of cheating going on here though. Awk doesn't support true multidimensional arrays. They are depending on a Gaw…

Actually I tried to do without true multidimensional arrays, but deleting and sorting elements would be a pain.
Post reply on HN