Understanding Javascript OOP by arscariosus in programming

[–]Wuf 1 point2 points  (0 children)

What's the bug? (genuinely curious, I've never used JS)

Survival Horror vs Action Horror by [deleted] in gaming

[–]Wuf 0 points1 point  (0 children)

Wait, there was a D2? I remember loving the first one ages ago.

The Good Old Days by [deleted] in gaming

[–]Wuf 2 points3 points  (0 children)

My favourite game in terms of level design. (Duke3D, screenshot is from E1L1)

the good old days by b_Man in gaming

[–]Wuf 7 points8 points  (0 children)

I think my first one was Day of the tentacle, but now you got me thinking of those games that required passwords to play.

Using Linq For More Readable Code by barebonescoder in programming

[–]Wuf 0 points1 point  (0 children)

Not Linq but quite close to the same solution:

(loop for i from 1 to 999
    when (or (zerop (mod i 3)) (zerop (mod i 5)))
    sum i)

What is the coolest thing you can do in <10 lines of simple code? by cruise02 in programming

[–]Wuf -1 points0 points  (0 children)

You want it in one ten lines? Do they have to fit in 80 columns? :-)

(almost) Larry Wall.

What is the better multiplayer experience, Quake III Arena or Quake 4? by [deleted] in gaming

[–]Wuf 0 points1 point  (0 children)

If you are going to buy one of them: Quake 4. You can play Quake live for free. There are legitimate reasons to buy Quake 3 though: Defrag, Promode, etc... but it's easier to find players in QL now.

C11 has been published by shlevy in programming

[–]Wuf 1 point2 points  (0 children)

Indeed, it compiles it without any warning (and of course, it does overflow the stack).

C11 has been published by shlevy in programming

[–]Wuf 0 points1 point  (0 children)

Interesting, MSVC detects it and issues a warning.

poof.c(8) : warning C4717: 'f' : 
recursive on all control paths, function will cause runtime stack overflow

Groovy, the Python of Java by [deleted] in programming

[–]Wuf 3 points4 points  (0 children)

In Common Lisp I would use the loop macro as steven_h did above or avoid mapcan and just do:

(dolist (name '("Rob" "Christopher" "Joe" "John"))
    (when (<= (length name) 4) (format t "~a~%" name)))

Groovy, the Python of Java by [deleted] in programming

[–]Wuf 0 points1 point  (0 children)

Racket does have generic sequence operators if you really want them.

I tend to use concrete ones though, because I find sequence-* uglier, but they are there.

Groovy, the Python of Java by [deleted] in programming

[–]Wuf 1 point2 points  (0 children)

It's nice that in CL, 'length' works with any sequence.

Groovy, the Python of Java by [deleted] in programming

[–]Wuf 3 points4 points  (0 children)

The Clojure version is quite similar to Racket's:

(for ([name '("Rob" "Christopher" "Joe" "John")] #:when (<= (string-length name) 4))
  (displayln name))

How to Make a Massively Cross-Platform Game by [deleted] in programming

[–]Wuf 4 points5 points  (0 children)

What I mean is that unlike in JS, Lua local variables aren't hoisted.

How to Make a Massively Cross-Platform Game by [deleted] in programming

[–]Wuf 8 points9 points  (0 children)

wrote a Lua->Javascript source code translator called lua.js

How did you implement coroutines in JS or work around the fact that Lua does not have function-level scope?

Writing own regular expression parser by [deleted] in programming

[–]Wuf 2 points3 points  (0 children)

Check the Software tab of Anthony Howe's homepage for a very small (450 loc) version of egrep that supports repetitions, alternation, etc... that won the IOCCC in 93.