code logs -> 2009 -> Thu, 12 Mar 2009< code.20090311.log - code.20090313.log >
--- Log opened Thu Mar 12 00:00:04 2009
00:09 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
00:31 You're now known as TheWatcher[t-2]
00:34 You're now known as TheWatcher[zZzZ]
00:46 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Quit: <Insert Humorous and/or serious exit message here>]
00:56 Derakon [~Derakon@Nightstar-4920.hsd1.ca.comcast.net] has quit [Ping Timeout]
02:18 Derakon [~Derakon@Nightstar-4920.hsd1.ca.comcast.net] has joined #code
02:18 mode/#code [+o Derakon] by ChanServ
02:37 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: "Restraint! Why are you so concerned with saving their lives? The whole idea is to kill the bastards! At the end of the war, if there are two Americans and one Russian, we win!"]
02:52 Consul [~consul@Nightstar-12789.dsl.sfldmi.ameritech.net] has quit [Quit: Leaving]
02:57 Consul [~consul@Nightstar-12789.dsl.sfldmi.ameritech.net] has joined #code
02:57 mode/#code [+o Consul] by ChanServ
03:03
<@Derakon>
Current status of the spacefilling algorithm: http://derakon.dyndns.org/~chriswei/games/jbrl/spacefill/03.gif
03:04
<@Vornicus>
Awesomesauce.
03:04
<@Vornicus>
Though the squares at the ends of lines are rather boring.
03:05
<@Vornicus>
Also could you extend the time on the last frame?
03:05
<@Derakon>
Not easily. :\
03:06
<@Derakon>
Well, I could...but for a simple "hey look guys" it's not really worth the effort.
03:06
<@Derakon>
Here, I'll just upload a still of the last frame...as soon as I finish recalculating the final map.
03:07
<@Derakon>
http://derakon.dyndns.org/~chriswei/games/jbrl/spacefill/03end.png
03:07
<@Derakon>
Right now I'm trying to figure out what's going on in the upper-left corner, where those two rooms are breaking the wall between them.
03:17 Molgorn [~moltare@Nightstar-16368.plus.com] has quit [Quit: Twisted, yes, but strangely fluffy.]
03:45
<@Reiver>
Did it at the bottom right, too.
03:45
<@Reiver>
... and upper left. Twice.
03:46
<@Reiver>
Methinks it could be something to do with your end box thingy.
03:46
<@Derakon>
I'm working at a more general level than that.
03:47
<@Derakon>
It has something to do with the way I try to reclaim walls that are contained within space that something wants to expand into.
03:47
<@Derakon>
It just so happens that currently this only happens with the 'room'-type sections and the ends of the trees.
03:52
<@Reiver>
Ah.
04:02
<@Derakon>
Okay, that's got it.
04:02
<@Derakon>
I just disabled reclaiming in the presence of unaligned expansion seeds.
04:02
<@Derakon>
And if that makes no sense...well, too bad. :)
04:03
<@Reiver>
How's that change the shape of the growth?
04:03
<@Derakon>
It prevents expansion from reclaiming walls that may be contested by another expanding area.
04:06
<@Derakon>
Latest map: http://derakon.dyndns.org/~chriswei/games/jbrl/mapgen17.png
04:06
<@Derakon>
...oh, damn, there's a bit of a knot or something near the lower-left.
04:06
<@Derakon>
What in blazes...?
04:07
<@Reiver>
I was about to mention.
04:07
<@Vornicus>
I like the bit just to the right of left-center, where there's two ne-sw corridors ending in rooms.
04:07
<@Reiver>
And also make a minor query as to whether it would be excessively difficult to shade the internal space a different color.
04:07
<@Vornicus>
And why is the upper left entirely empty?
04:07
<@Derakon>
Just happened to work out that way, Vorn.
04:08
<@Derakon>
Randomness is random!
04:08
<@Derakon>
As for shading: it's something I'll have to work out eventually, but it's not a high priority.
04:08
<@Reiver>
I was mostly just thinking for ease of viewing on these outputs.
04:08
<@Reiver>
Looks like one of the nodes slammed into a wall instead of heading up, Vorn
04:08
<@Derakon>
That's actually a "room"-type tunnel.
04:08
<@Derakon>
It gets a small expansion in the middle.
04:09
<@Derakon>
You can see another one in the bottom-middle.
04:10
<@Derakon>
Ahh, I see what happened here. Two corridors came too close together and their expansion seeds overlapped, causing instant walls.
04:10
<@Reiver>
Idly: Is this an actual platformer with up/down involving Teh Jumpings?
04:10
<@Derakon>
The irregular-type tunnels (as opposed to straight ones) are a bit hard to deal with WRT blocking self-intersections.
04:10
<@Derakon>
That's the idea, yes.
04:10
<@Reiver>
So the up/down segments will involve Lots Of Jumping to climb.
04:11
<@Derakon>
Yeah.
04:11
<@Derakon>
Though your character will be able to walk up 45°-slopes without difficulty.
04:11
<@Reiver>
So the bottom left would require jumping rather than simple climbing?
04:13
<@Derakon>
Yeah, at least a little.
04:13
<@Derakon>
It's composed mostly of 45°-slopes, but with the occasional straight wall.
04:14
<@Reiver>
Aha.
04:23
<@Derakon>
Okay, try this on: http://derakon.dyndns.org/~chriswei/games/jbrl/mapgen17b.png
04:23
<@Derakon>
I just bit the bullet and drew lots of unnecessary rectangles for this version, since the "output the entire map" stuff doesn't need to be performant.
04:24
<@Derakon>
This took 5.6s to make, by the way, not counting saving the file to disk.
04:24
<@Vornicus>
There's a tunnel between two blocks on the bottom right-center.
04:24
<@Derakon>
Yeah, there's something making floating blocks for some reason that I haven't tracked down yet as I had bigger concerns.
04:25
<@Reiver>
Derakon: Holy crap, that looks awesome.
04:25
<@Derakon>
Thanks.
04:26
<@Vornicus>
I actually like that little tiny tunnel.
04:26
<@Vornicus>
Is the Jetblade character taller than one tile?
04:26
<@Derakon>
Certainly.
04:27
<@Vornicus>
ok then.
04:27
<@Derakon>
These blocks are 10x10 pixels, BTW.
04:27
<@Derakon>
(Shrunk a bit for the web version to keep filesizes vaguely sane)
04:27
<@Derakon>
I figure that the Jetblade character will be 2.5 to 3 blocks tall and 1 block wide.
04:27
<@Derakon>
Roughly Samus proportions, in other words.
04:36
<@McMartin>
2 blocks for full run animation, surely?
04:36
<@Derakon>
Something like that, yeah.
04:37
<@McMartin>
That's also Super Mario proportions, then.
04:37
<@McMartin>
He's 3x2
04:37
<@Derakon>
His head's bigger than I plan on making my protagonist's.
04:37
<@Vornicus>
Super Mario is, in most Mario games, 2x1.
04:38
<@Vornicus>
And he's got Short Stubby Legs.
04:39
<@McMartin>
"1" is 8 pixels on the NES, and that sounds Insufficient.
04:39
<@Vornicus>
well, I mean world units, not hardware units.
04:39
<@Derakon>
Most world blocks on the NES are 2x2.
04:39
<@Vornicus>
Almost all NES games use 16x16px world units; this includes all the Super Mario Brothers games.
04:40
<@McMartin>
Yes
04:40
<@Vornicus>
I'm using those as the definition - and, at that, I'm pretty certain the SNES also uses 8x8 hardware units.
04:40
<@McMartin>
This is, incidentally, because the NES only let you set colors in 16x16 blocks, despite graphical tiles themselves being 8x8.
04:40
<@Derakon>
I know that Super Metroid does something similar with its block sizes, anyway.
04:41
<@Derakon>
I've seen a few hacks that use smaller-than-normal map components, and they look weird if they're part of platforms.
04:42
<@Vornicus>
Super Mario Land uses 8x8 world units; Mario is 2x1 in that too.
04:44
<@Vornicus>
(this, by the way, is physical size - many games, like mario 3, use a larger graphics size. Kuribo's shoe and Kirby are both 18px wide.)
04:54 * Derakon idly takes a moment to note how easily the eye is fooled.
04:54
<@Derakon>
There's one pixel of black between the white walls and the grey unfilled space in that map. And that's enough to make the walls look like they're popping above the surface.
04:58
<@Derakon>
Man, these maps look so organic. <3
04:58
<@Derakon>
I mean, the terminus rooms are semirectangular, but the rest...
04:58
<@Derakon>
...aaaand I just found a loop. >.<
04:58
<@Reiver>
Derakon: I noticed that. It looked pretty good, actually. It was an error?
04:59
<@Derakon>
Reiver: it wasn't intentional, let's put it that way.
04:59
<@Reiver>
Ah. :)
05:02 Syloqs-AFH [Syloq@Admin.Nightstar.Net] has quit [Connection reset by peer]
05:32
<@Vornicus>
Wow, my vb homework is unspeakably boring.
05:37 AnnoDomini [~farkoff@Nightstar-29498.neoplus.adsl.tpnet.pl] has joined #Code
05:37 mode/#code [+o AnnoDomini] by ChanServ
05:46
<@Derakon>
Okay, I'm too tired to bugfix now.
06:02
<@Vornicus>
Like, I've spent 3 hours on two problems because I get /so incredibly distracted/ by /rereading all my feeds/
06:03
<@Reiver>
Hum.
06:03
<@Reiver>
And here I am, getting stumped on basic Haskell.
06:03
<@Reiver>
Wanna swap?~
06:06
<@Derakon>
Y'all can't have my mapgen project. >.>
06:07 * Vornicus wants to work on VornMoO! ;_;
06:08 Derakon is now known as Derakon[AFK]
06:11 * Vornicus also wants to work on his series of Math Reference Handouts, the first of which he did today.
06:14
<@Vornicus>
(I did Signed Arithmetic.)
06:41
<@jerith>
What kind of level are they aimed at?
06:41
<@jerith>
Also, you need to write for your cs lectures LJ some more. ;-)
06:42
<@Vornicus>
jerith: they are for Basic Math students: it tells you how to determine the sign and magnitude of the result of the five basic operations on signed numbers.
06:42
<@Vornicus>
Only one thing in there is /not/ generally covered in this course: what to do with a negative exponent.
06:55
<@Vornicus>
gah, fucking docx. I can't read my own file!
06:56
<@jerith>
Quite.
06:56 * jerith offers LaTeX and emacs, then hides behind Knuth and RMS.
06:57
<@Vornicus>
LaTeX I can do.
06:57
<@Vornicus>
emacs not so much.
06:57
<@Vornicus>
(though I don't really know how to do tables in LaTeX, and except for one tiny piece I can do all of this in html, and that's not really necessary.)
06:59
<@Vornicus>
And here I am getting distracted AGAIN
06:59
<@Vornicus>
I have spanish homework to do too!
06:59
<@jerith>
Write the maths in Spanish?
07:00
<@Vornicus>
Won't do the homework.
07:21
<@Vornicus>
Meh, screw it, do it in the morning. DOcument is remade on google docs; I'm trying to figure out how to make it completely public.
07:22
<@Vornicus>
You can see it though via your firxen account.
07:24
<@Vornicus>
and now bedtime.
07:29 Vornicus [~vorn@Admin.Nightstar.Net] has quit [Quit: ]
08:41
<@McMartin>
Urgh. Continuation-passing style makes my brain hurt.
08:50 You're now known as TheWatcher
08:50 * McMartin finally cracks by realizing it is the bastard child of GOTO and the lambda calculus.
08:51
<@McMartin>
Er, cracks it
08:51
<@McMartin>
I remain uncracked.
08:51
<@McMartin>
Probably.
08:53
<@Reiver>
McM: I would like to make the note that I'd appreciate a lesson in lambda calculus at some point.
08:54
<@Reiver>
I get the distinct impression it has a lot to do with recursion, and by inference, Haskell. ;)
08:54
<@McMartin>
It has crazed, unplumbed depths.
08:54
<@McMartin>
The basic bit is very simple, but the rabbit goes all the way down.
08:54
<@McMartin>
Seriously. All the way down.
08:55
<@McMartin>
The basic idea is that it is the logic of functions and function application.
08:55
<@McMartin>
The madness comes in at various other points.
08:55
<@McMartin>
An example, which programming languages do *not* use
08:55
<@McMartin>
You can build the natural numbers out of nothing but function applications.
08:56
<@McMartin>
Actual things for the functions to act on need not be defined, since we've got these functions we can use as arguments.
08:56
<@McMartin>
Observe:
08:56
<@McMartin>
Take the identity function: \x -> x
08:56
<@McMartin>
(I use \ here to mean "lambda", being both ASCII and the Haskell syntax for it.)
08:56
<@McMartin>
Let's call the identity function zero.
08:57
<@McMartin>
Here's another functions: \x -> \ -> x
08:57
<@McMartin>
Let's call that "successor."
08:57
<@McMartin>
It takes an argument and returns a function that takes no arguments but evaluates to the original argument.
08:57
<@McMartin>
We can now build the natural numbers.
08:58
<@McMartin>
Identity function = 0
08:58
<@McMartin>
Function that returns the identity function = 1
08:58
<@McMartin>
Function that returns the function that returns the identity function = 2
08:58
<@McMartin>
etc.
08:58
<@McMartin>
You can build *all of arithmetic* this way.
08:58
<@Reiver>
I, uh. Wow. Okay.
08:58
<@Reiver>
So what precisely is lambda?~
08:58
<@McMartin>
Lowercase greek letter l
08:58
<@Reiver>
Right
08:59
<@McMartin>
No, I mean, that's all it is.
08:59
<@McMartin>
It's used to indicate "This is a function"
08:59
<@McMartin>
The most general version of this goes something like this...
08:59
<@McMartin>
\ a b c -> (expression involving a, b, and c)
08:59
<@Reiver>
... so lambda is a synonym for <i>f</i>?
08:59
<@McMartin>
Sort of. The idea is that they're anonymous.
08:59
<@McMartin>
You can assign names to things using lambdas, too~
09:00
<@Reiver>
anonymous?
09:00
<@McMartin>
Therefore, names are optional, and early-20th-century pure mathematicians had no need for them.
09:00
<@McMartin>
OK, let's switch to Python.
09:00
<@Reiver>
Ahhh.
09:00
<@McMartin>
I'm going to pretend list comprehensions don't exist, and so I want to write "map" myself.
09:01
<@Reiver>
So the idea is tha lamda x is f(x), 'but we don't care what f actually /is/, jut what it /does/'?
09:01
<@McMartin>
I take a function and a list, and I return a list with that function applied to each member of the list.
09:01
<@McMartin>
Now, I *could* do this to add one to each member...
09:01
<@McMartin>
def add1(x): return x + 1
09:01
<@McMartin>
and then call...
09:01
<@McMartin>
map(add1, [1, 2, 3])
09:01
<@McMartin>
and get [2, 3, 4]
09:01
<@McMartin>
Right?
09:02
<@Reiver>
Right
09:02
<@McMartin>
This is, however, kind of retarded. We'd like to inline that function and use it as a value without actually *defining* it.
09:02
<@McMartin>
Ergo:
09:02
<@McMartin>
map(lambda x: x+1, [1, 2, 3])
09:02
<@McMartin>
which gets you the same result.
09:03
<@McMartin>
(And it does; that's valid Python right there.)
09:03
<@McMartin>
The LISP for that is...
09:04
<@McMartin>
(map (lambda (x) (+ x 1)) (1 2 3))
09:04
<@McMartin>
And the Haskell for it is...
09:04 * TheWatcher eyes
09:04
<@TheWatcher>
Reiv, run
09:04
<@McMartin>
map (\x -> x + 1) [1, 2, 3]
09:04
<@TheWatcher>
Run now
09:04
<@Reiver>
So lambda is 'function that we haven't bothered to name'?
09:04
<@TheWatcher>
Before the madness takes you
09:04
<@McMartin>
Pretty much.
09:04
<@Reiver>
'because the name is irrelevent'?
09:04
<@Reiver>
Oho. This makes a little more sense.
09:05
<@McMartin>
It also implies that the function and its environment are encapsulated, but that gets into upvalues, the relationship between functional and object-oriented programming, and why you won't run into any of this in C.
09:05 * TheWatcher took an entire semester on lambda calculus in uni, rates it as the worst course he has ever endured, and has never actually applied any of it in the least 11 years
09:05
<@Reiver>
TW: I realise its reputation.
09:05
<@Reiver>
And yet, I am finding some of the more basic bits of Haskell to be constant tripping points.
09:05
<@Reiver>
Rather than learning the nuances of the Arcane Incantation, I want to know how I should do it.
09:05 * McMartin on the other hand was very sad that he couldn't abuse nested lambdas to simulate objects in Python.
09:06
<@TheWatcher>
Well, yes, that's functional programming. I'm moderately convinced that people who write functional 'terps intentionally set out to fuck wiht people's headbones.
09:06
<@McMartin>
Hey now, Haskell and ML are both compiled.
09:06
<@McMartin>
LISP is too, but nobody bothers anymore
09:07
<@Reiver>
(Obsolete?)
09:07
<@Reiver>
TW: Yeees, though this problem has reared its ugly head before when trying to get my head around how to drive Pythons lists and dictionaries
09:07
<@McMartin>
(Too dynamic)
09:07
<@McMartin>
(Same reason Python doesn't get compiled, basically)
09:07
<@Reiver>
Which makes me suspect that I have a slightly more fundamental issue.
09:07
<@Reiver>
(... too dynamic?)
09:07
<@McMartin>
(ML and Haskell insist that each variable have a specific type. LISP, like Python, lets you mix numbers, strings, lists, dictionaries, whatever freely)
09:08
<@McMartin>
(The latter is notoriously difficult to compile into anything resembling efficient code)
09:08
<@McMartin>
(And ends up basically being about as fast as its interpreter since you're spending all your time seeing what type it is *this* time)
09:08
<@Reiver>
(...Aaah. Okay.)
09:08
<@TheWatcher>
Um, I'll put it this way, reiv: lambda calculus eas a second semester course in the last year of my undergrad degree. We learnt SML in first year without it. Knowing lambda calculus will not, IMO, aid you in understanding anything other than what madness truly is
09:09
<@McMartin>
TW: Reiver is currently having trouble with the idea of "first-order functions".
09:09
<@McMartin>
You kind of need that even to do OO design.
09:09
<@Reiver>
TW: Okay, fine. But I'm still struggling with some sort of basic syntactical/conceptual issue with list recursion, when recursion itself I am quite comfortable with
09:10 * Reiver used recursion before he even knew what it was. >_>
09:10
<@McMartin>
The list stuff specifically is unfamiliarity with basic data structures, I think.
09:10
<@Reiver>
Yeah
09:10
<@McMartin>
Functions on lists in ML/Haskell/LISP have to work with three basic constraints.
09:11
<@McMartin>
- You know what the empty list is, and you can grab one at will
09:11
<@McMartin>
- You can take a list and put something at the front of it
09:11
<@McMartin>
- You aren't allowed to (Haskell) or are very strongly discouraged from (all others) actually modifying entries in place.
09:11
<@McMartin>
So, to go back to map
09:11
<@McMartin>
You have a function and a list.
09:12
<@Reiver>
(Or... I can often get my head around the idea of how the things are put together, but the actual implementation and use of them in terms of syntax /still/ throws me. Which is irritating.)
09:12
<@McMartin>
This can be defined recursively as...
09:12
<@Reiver>
Oooh, ooh
09:12
<@Reiver>
lemme think.
09:12
<@McMartin>
OK, I leave this one to you.
09:12
<@McMartin>
The syntax in Haskell for these is...
09:12
<@McMartin>
null : [a] -> Bool; returns true if its argument is the empty list
09:12
<@McMartin>
[] <- The empty list
09:13
<@McMartin>
x:l <- adds x to the front of the list l
09:13
<@Reiver>
map :: a [a] -> [a]
09:13
<@McMartin>
[1, 2, 3] is equivalent to 1:2:3:[]
09:13
<@McMartin>
Not quite.
09:13
<@Reiver>
Oop?
09:13
<@McMartin>
a is the type of an element of the list.
09:13
<@McMartin>
the first argument to map is the mapper function.
09:14
<@Reiver>
Oh.
09:14
<@McMartin>
So it's got to be, at minimum, map :: (_ -> _) ...
09:14
<@McMartin>
The first [a] is, however, correst.
09:14
<@McMartin>
You're missing a trick, though.
09:14
<@McMartin>
BUt continue.
09:14
<@McMartin>
If it's ??? [a] -> [a], what is ??? ?
09:14
<@Reiver>
A function, whose actual syntax I am fuzzy on.
09:16
<@McMartin>
Well, it's taking an element of a list of type [a], and producing the same, right?
09:16
<@McMartin>
Thus, a -> a
09:16
<@McMartin>
map :: (a -> a) [a] -> [a]
09:16
<@McMartin>
Here's the trick you missed...
09:16
<@Reiver>
Aha
09:16
<@Reiver>
Hm.
09:16
<@McMartin>
... there's no reason that it has to be the same type.
09:16
<@McMartin>
We could map a list of strings to a list of their lengths.
09:16
<@McMartin>
The true type of map is thus...
09:17
<@McMartin>
map :: (a -> b) [a] -> [b]
09:17
<@Reiver>
... oh, right. List has to be the same internally, as opposed to 'may not be changed'.
09:17
<@McMartin>
Well, it still can't.
09:17
<@McMartin>
You're building a *new* list as your result.
09:17
<@Reiver>
Er. Yes. >.>
09:17
<@McMartin>
Observe.
09:17
<@McMartin>
Map of an empty list is the empty list for all mappers.
09:18 * Reiver really needs to work on his language~
09:18
<@McMartin>
map f [] = []
09:18
<@Reiver>
map f [] = []
09:18
<@Reiver>
... oi~
09:18
<@Reiver>
map f [x:xs] = fx : map f [xs]
09:18
<@McMartin>
Close.
09:18
<@McMartin>
Idea is right, syntax doesn't work.
09:18
<@McMartin>
x:xs is a list
09:18
<@McMartin>
[x:xs] is a list of lists with one element.
09:19
<@Reiver>
... really? Oh.
09:19
<@Reiver>
No wonder my code keeps not running~
09:19
<@McMartin>
The second part should be...
09:19
<@McMartin>
map f (x:xs) = (f x):(map f xs)
09:19
<@McMartin>
Some of those parens can probably go away, but I'm not used enough to language yet to know which ones.
09:20
<@McMartin>
Also, you'll want to call it my_map or something
09:20
<@McMartin>
Since map is part of the standard library.
09:20
<@Reiver>
Oh, yes
09:20
<@Reiver>
This was a theoretical exploration of lists.
09:20
<@Reiver>
Still... sort of good to know I have the /idea/ right. Mental note that I've a lot to work on with the syntax, tho. :/
09:21
<@McMartin>
So, I'm going to sleep now.
09:21
<@McMartin>
Here's your homework ;-)
09:21
<@McMartin>
Define filter.
09:21
<@Reiver>
eep~
09:21
<@Reiver>
... step one, look up filter. >_>
09:21 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has quit [Ping Timeout]
09:21
<@Reiver>
Nini!
09:21
<@McMartin>
Getting there.
09:21
<@McMartin>
filter :: (a -> Bool) [a] -> [a]
09:21
<@McMartin>
Takes a predicate function "p" and a list l.
09:22
<@McMartin>
filter p l returns the list of all members of l, in order, for which p is true.
09:22
<@McMartin>
(The 'in order' should fall out of the recursive definition; you won't have the opportunity to misorder them)
09:22 * Reiver eyes that. There isn't an if statement involved, is there...
09:22
<@McMartin>
<_<
09:23
<@McMartin>
It's an if *expression* in Haskell, remember. You can use it anywhere you'd use the ?: stuff in C/Java
09:23
<@McMartin>
Bonus problem which I do not expect you to solve:
09:23
<@McMartin>
Define a function that takes a list and returns it with all elements in reverse order.
09:23
<@Reiver>
... you evil bastard. Rest well. :P
09:23
<@McMartin>
That will lead us into Tail Recursion, later on.
09:24
<@McMartin>
Then I'll have an excuse to touch on Continuations, which are the Mysteries I am currently contemplating.
09:25
<@McMartin>
Also, delicious curry, which may be sort of slipped in sideways.
09:26
<@McMartin>
Short form: In Haskell, all functions only take one argument. The fact that they appear to take more is a trick, and one that you can exploit for horrendous awesome.
09:26
<@McMartin>
And then all other langauges hurt you for lacking it ;_;
09:30 * Reiver laughs.
09:43 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
10:23 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has quit [Quit: Rhamphoryncus]
10:25 You're now known as TheWatcher[afk]
10:38
<@MyCatVerbs>
We should totally get a couple of evalbots in here.
10:40
<@MyCatVerbs>
Also, you can shadow names from the Prelude just fine in Haskell. It's just that you often shouldn't.
12:45 You're now known as TheWatcher
13:03 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
13:03 mode/#code [+o Attilla] by ChanServ
13:41 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
13:41 mode/#code [+o gnolam] by ChanServ
15:03 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
15:04 crem_ [~moo@Nightstar-28703.adsl.mgts.by] has quit [Ping Timeout]
15:05 Syloqs_AFH is now known as Syloqs-AFH
15:10 Syloqs-AFH [Syloq@Admin.Nightstar.Net] has quit [Connection reset by peer]
15:13 KBot [AnnoDomini@Nightstar-27889.neoplus.adsl.tpnet.pl] has joined #Code
15:13 AnnoDomini [~farkoff@Nightstar-29498.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
15:14 KarmaBot [AnnoDomini@Nightstar-29498.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
15:15 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
15:16 KBot is now known as KarmaBot
15:16 Syloqs_AFH is now known as Syloqs-AFH
15:20 AnnoDomini [~farkoff@Nightstar-27889.neoplus.adsl.tpnet.pl] has joined #Code
15:20 mode/#code [+o AnnoDomini] by ChanServ
16:19 You're now known as TheWatcher[afk]
16:21 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
16:22 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
16:22 mode/#code [+o Attilla] by ChanServ
17:39
<@MyCatVerbs>
if (clients[cno].faction = FAC_NONE) { fprintf(stderr,"Need to do way instain mother, %d.\n",cno); return; } // extract from current code base, in the drop_client function.
17:55
<@ToxicFrog>
18:04 Moltare [~moltare@Nightstar-16368.plus.com] has joined #code
18:04
< Moltare>
Gentlemen! who here knows their XML DOM malarkey?
18:07
<@ToxicFrog>
DOM in general: yes. luaXML DOM: yes. Whatever specific DOM library you're using: probably not.
18:09
<@TheWatcher[afk]>
In general: yes. Perl DOM: yes. libXML(2): yes. Java DOM: attempted to blank it from my memory
18:09 You're now known as TheWatcher
18:09
< Moltare>
Well, I'll pester the pair of yez about it then ;)
18:09
< Moltare>
I have a PHP script that produces the following XML:
18:09
< Moltare>
(little spam)
18:09
< Moltare>
<categories>
18:09
< Moltare>
<category>
18:09
< Moltare>
<attribute1 value="attr1val"/>
18:09
< Moltare>
<attribute2 value="attr2val"/>
18:09
< Moltare>
</category>
18:09
< Moltare>
<category>
18:09
< Moltare>
<attribute1 value="more1val"/>
18:10
< Moltare>
<attribute2 value="more2val"/>
18:10
< Moltare>
</category>
18:10
< Moltare>
</categories>
18:11
<@ToxicFrog>
Ok.
18:11
< Moltare>
AIUI I can, in Javascript, do var outputXML = (an XMLHTTPRequest to this PHP script)
18:12
< Moltare>
which will then contain all the nodes of <categories> in their appropriate hierarchy
18:13
< Moltare>
But what can I do with it thereafter? It seems messy to have to (for each category (for each attribute (pop and output the value to the right place))
18:15
< Moltare>
((plus I'm still getting these 1012 errors and no two sources agree on how to overcome it ¬¬))
18:15
<@TheWatcher>
(well, that's javascript for you ¬¬)
18:16
<@TheWatcher>
What /are/ the right places? It may be that nested loops are the right thing to do, if it involves copying values into other places and there's no way to get those other places to look into your dom tree as-is
18:18
< Moltare>
Well, my first aim is to get a single category dropping attribute1's value into one label and attribute2's value into another.
18:18
< Moltare>
I can build on that when it works
18:21
<@TheWatcher>
Well, I'd start off by doing it the simple way - which will be just nested loops - and then go from there depending on how it words
18:24
< Moltare>
Other thing is, would <categories> be firstChild in that, and <category> be firstChild.firstChild, etc?
18:25
< Moltare>
or is there a more direct way?
18:28 Derakon[AFK] is now known as Derakon
18:29
< Moltare>
hm. Would document.categories.category.attribute1.value resolve to "attr1val"? 'cos that would be the neatest way to do it, if so
18:42
<@Derakon>
I just realized that my spacefilling algorithm is a cellular automata. ¬.¬
18:46 * Moltare takes it down a step of simplicity, tries a new question:
18:46
< Moltare>
var xmlOut is an XML document containing only <events><event value="foo"></events>
18:47
< Moltare>
How do I set var xmlOutValue to the value of that <event> tag?
18:48
<@Derakon>
What language is this?
18:48
<@Derakon>
Also, that's malformed XML; it should be '<event value="foo"/>' to close the event tag.
18:49
< Moltare>
yes, I keep doing that
18:49
< Moltare>
It's javascript.
18:50 * Derakon eyes http://www.w3schools.com/Xml/tryit.asp?filename=tryxml_parsertest
18:51
<@Derakon>
That tells you how to get the value of e.g. "<event>foo</event>".
18:51
<@Derakon>
In any event, you can get the tag itself using xmlOut.getElementsByTagName("event")[0].
18:52
< Moltare>
aha! how handy
18:52
< Moltare>
cheers
18:52
<@Derakon>
According to that, anyway.
18:53
<@Derakon>
Try child.getAttribute('value').
18:53
<@Derakon>
According to http://social.msdn.microsoft.com/Forums/en-US/netfxjscript/thread/cd0a5c96-aa0d- 4220-a26f-6ae79c2f2539/
19:08
<@TheWatcher>
I note that one of the big problems you're going to run into, mol, is that there is no decent definition of javascript - each browser does it a bit differently :/
19:09
< Moltare>
blarg
19:17
< Moltare>
oh, for crying out loud. I'm trying to test a popup window that inherits a value from the main window, applies that to the php script, and uses the results to populate itself with data. I can get around the cross-domain restrictions which I still haven't been able to fix by hosting the program on the same site as the scripts... but this breaks the restrictions against opening a popup from a document!
19:17
< Moltare>
aaaaaaaaaaaa
19:18
< Moltare>
horrible gittery of the first water
19:52 crem [~moo@Nightstar-28703.adsl.mgts.by] has joined #code
19:59
<@ToxicFrog>
Welcome to web design.
19:59
<@ToxicFrog>
By which I mean concourse D, O'Hare International Airport.
19:59
<@ToxicFrog>
By which, of course, I mean Hell.
20:04 * gnolam laughs out loud.
20:11
<@TheWatcher>
How very painfully true >.>
20:12
<@gnolam>
"It can hardly be a coincidence that no language on Earth has ever produced the phrase, as pretty as an airport. Airports are ugly. Some are very ugly. Some attain a degree of ugliness that can only be the result of a special effort."
20:13
<@ToxicFrog>
(I ganked that from Dave Barry, actually~)
20:29
<@McMartin>
Back when he was good~
20:36
<@Derakon>
I want to call a function repeatedly until it does not return 1.
20:36
<@Derakon>
So I'm doing "while not function(): pass"
20:36
<@Derakon>
But it's only being called once?
20:38
<@TheWatcher>
I'm no pythoner, but won't that only run while it returns 0?
20:38
<@Derakon>
...thank you.
20:45 * Derakon stops another source of leaky rooms.
20:46
<@McMartin>
12:59 <@ToxicFrog> Welcome to web design.12:59 <@ToxicFrog> By which I mean concourse D, O'Hare International Airport.
20:46
<@McMartin>
12:59 <@ToxicFrog> By which, of course, I mean Hell.
20:46
<@McMartin>
This kind of thing is why Google Web Toolkit and similar systems treat Javasript as "the assembly language" and never write in it directly.
20:49 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
21:11
<@Derakon>
http://derakon.dyndns.org/~chriswei/games/jbrl/spacefill/04.gif
21:13
<@McMartin>
Derakon: Are you counting "vert" as a lock?
21:14
<@Derakon>
I don't understand the question.
21:15
<@McMartin>
So, there's lots of places where you have to go way up
21:15
<@McMartin>
Presumably our hero doesn't start able to pull that off
21:18
<@Derakon>
Actually, looking at this map, most of it is navigable straight off. The taller rooms and the downwards shaft left of center would be a problem though. (Still of last frame: http://derakon.dyndns.org/~chriswei/games/jbrl/spacefill/04end.png )
21:18
<@McMartin>
(Well, you could fill them with platforms a la metroid)
21:18
<@Derakon>
I haven't started my navigation analysis yet, though. This is all just making a starting point.
21:18
<@Derakon>
Right, that's one option.
21:18
<@McMartin>
(And then the "High Jump" key has a "lock" that is broader-spaced platforms.)
21:19
<@Derakon>
Right.
21:19
<@Derakon>
Basically what I'm doing here is making the rooms and tunnels that the locks and keys will be placed within.
21:21 * McMartin plows through more of YAHT while his work code compiles.
21:21
<@Derakon>
Yet Another...?
21:21
<@McMartin>
Haskell Tutorial.
21:21
<@Derakon>
You too?
21:21
<@McMartin>
The actual gentle introduction to Haskell.
21:21
<@McMartin>
Yeah.
21:21
<@McMartin>
In my case, because people were trying to extend/reverse engineer some IF decompilers written in it.
21:22
<@McMartin>
BY THE SURLY BEARD OF MRIFK, GRIGNR BOWS TO NO MAN
21:22
<@Derakon>
...reverse engineer an IF compiler.
21:22
<@McMartin>
IF *de*compiler.
21:22
<@Derakon>
Er, decompiler.
21:22
<@McMartin>
As in, "it doesn't work right, we want it to."
21:22
<@Derakon>
Is decompiling IF programs a problem?
21:22
<@McMartin>
It's often easier than asking for hints~
21:22
<@McMartin>
At the very least, we'd like to dump string tables.
21:23
<@McMartin>
However, it's not doing that right, so we were looking at fixing it
21:23
<@McMartin>
Which becomes...
21:23
<@McMartin>
Step 1: Learn Haskell
21:23
<@Derakon>
Why not just distribute the uncompiled game?
21:23
<@McMartin>
... because... we didn't write it?
21:23
<@Derakon>
I meant as a community standard.
21:23
<@McMartin>
Generally, source isn't available.
21:24
<@McMartin>
The community does not have OSS sensibilities with respect to IF, for a variety of actually good reasons I don't feel like rehashing right now.
21:24
<@McMartin>
Tools, yes.
21:24
<@McMartin>
Games, no.
21:24
<@Derakon>
Okay, fair enough.
21:25
<@McMartin>
Not to mention that the binary formats include stuff for which source is lost/was never distributed in the first place.
21:25
<@McMartin>
Anyway!
21:25
<@McMartin>
The Glulx decompiler was not updated to the latest standard and cannot deal with strings anymore.
21:25
<@McMartin>
And the guy who wrote it has basically vanished.
21:25
<@McMartin>
So we were looking at extending it.
21:25
<@McMartin>
My step 1 is "learn Haskell"
21:26
<@McMartin>
Another guy is trying to learn enough to reverse its algorithms and rewrite it in Python (it's only a few thousand lines)
21:26
<@McMartin>
But I've been meaning to learn Haskell anyway, so this is an excuse for me.
21:26
<@McMartin>
(Also re: this, "not everything is standards compliant.")
21:26 * Derakon nods.
21:27
<@McMartin>
I'd like to reverse it because I've never really Gotten huffman encoding/decoding, so picking apart an implementation thereof would be educational.
21:27
<@McMartin>
(And one of the bugs is in that bit~)
21:28 * Derakon ponders more cellular automata for determining accessibility of the map.
21:29
<@Derakon>
Basically I start at the center of the map and then determine "connectivity" of components.
21:29
<@Derakon>
Unconnected components either need to have their maps modified to become connected, or require powerups to access.
21:31
<@Derakon>
The rules for such an automata would get very complicated very fast, I suspect...
21:32
<@Derakon>
Especially given that the size of the cells would need to be larger than the size of the blocks (given a larger-than-one-block protagonist)
22:15
< Moltare>
yyyeeesssss ahahahah it populates
22:15
< Moltare>
it all populates
22:15 * Moltare spins, twirls, goes for a cuppa
22:32 * Derakon adds removal of islands.
22:32
<@Derakon>
It took 5.082s to make a 270x195 map.
22:45
<@Reiver>
Derakon: Do you have a thematic aspect to the game yet?
22:45
<@Derakon>
Sci-fi.
22:46
<@Reiver>
Dungeon crawl, alien moonbase...?
22:46
<@Derakon>
Jetblade itself is meant to be sited at a biological research lab that was thought to be abandoned.
22:46
<@Derakon>
This will be somewhat similar, but the entirety of the game will be underground, so that's a bit limiting.
22:47
<@Reiver>
Ah, 'underground'. Excelent.
22:47
<@Derakon>
But the plan is to have basic caves, jungle caves, fire caves, and water caves.
22:47
<@Derakon>
And maybe a techbase cave, but it'll be tricky to make those less organic than the others~
22:47
<@Reiver>
Do you plan to, eg, have a small tunnel you leap into from Above?
22:47
<@Reiver>
Naaah. Rig the automata to just make a billion box rooms~
22:47
<@Derakon>
Not as it stands. The map starts in the middle for maximal expansion room.
22:48
<@Derakon>
Much of the organicness of the current maps is from tunnels running into each other.
22:48
<@Reiver>
Oh, sure. Er. You said you were planning to install loops etc manually after it finished growing
22:48
<@Derakon>
I can easily get rooms that have one straight wall, or two partially-straight walls that make a right angle...
22:48
<@Reiver>
My initial thought was it found a starting room and dug a shaft down.
22:48
<@Derakon>
That limits what I can do with the upper tunnels.
22:49
<@Reiver>
True, I suppose. 'twas just a thought, though.
22:49
<@Derakon>
It's easier to put a 3D tunnel in the middle of the map, like Spelunky's doors.
22:49 * Derakon nods.
22:49
<@Reiver>
And the 'surface' was an addon Boring Flat Bit With A Hole In it.
22:49
<@Derakon>
Heh.
22:49
<@Reiver>
(I do note that the middle of your map tends not to be a room, but a set of tunnels with a hole right below~)
22:50
<@Derakon>
There's more than enough open space in the middle of the map to put a feature in.
22:50
<@Derakon>
Not a very big feature, but a platform to stand on with a custom background graphic has plenty of room to play.
22:51
<@Reiver>
...! Tech base idea: It's a ruin. You run some algorithmn on the map after its generated to make all the Nice Flat Bits proper slabs of steel... and all the zigzaggy bits you couldn't get straight get rendered with Rusted Twisted Metal tiles. :p
22:51
<@Reiver>
Vola, a handwave for the map layout~
22:52 * Derakon facepalms.
22:52
<@Derakon>
I had had something like that in mind, ye s.
22:52
<@Reiver>
But not quite so brazen? ¬¬
22:52
<@Derakon>
But a proper tech base should have some nice straight tunnels in addition to the nice straight rooms.
22:53
<@Reiver>
True.
22:53
<@Reiver>
Option #2 is to have a second-pass thing where it takes mostly-straight bits and smooths them without breaking the basics of the layout, I suppose?
22:53
<@Derakon>
Yeah, something like that.
22:54
<@Reiver>
*nod*
22:54
<@Derakon>
Ideally, the tunnels would also be either straight up and down or straight left and right...but I don't think I can reasonably rig that.
22:54
<@Reiver>
Nothin' wrong with straight diagonals, I figure
22:55
<@Reiver>
... that could work well, actually. Smooth The Smoothable Bits. If Not Smoothable, Mark For 'Ruin' Graphics Instead.
23:14 AnnoDomini [~farkoff@Nightstar-27889.neoplus.adsl.tpnet.pl] has quit [Quit: Quem quer o garfo?]
23:23 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Quit: <Insert Humorous and/or serious exit message here>]
23:30 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
23:30 mode/#code [+o Attilla] by ChanServ
23:30 * Derakon sighs, tries to decide where to start for accessibility testing.
23:33
<@Derakon>
Let the character's size be 1x3, jump height be 3 blocks, jump length be 6 blocks wide (45° parabola, in other words).
23:34
<@Derakon>
The space above a block is at least plausible if there are at least three open spaces above the block.
23:35
<@Derakon>
Then what, do I start tracing parabolas from accessible spaces?
23:35
<@Derakon>
And there's also directionality to be concerned with...it's entirely possible to get into an area but be unable to get out.
23:39
<@Derakon>
Mmm...for directionality, let's assume that I'll be making everything accessible except where I intentionally break accessibility as a lock.
23:39 You're now known as TheWatcher[T-2]
23:41 You're now known as TheWatcher[zZzZ]
23:55 Moltare is now known as Molgorn
23:59
<@ToxicFrog>
Gnar. I think my Haskell is too rusty.
23:59
<@ToxicFrog>
A Neighborhood of Infinity isn't making any sense to me.
23:59
<@ToxicFrog>
Or maybe that's just the monads ;.;
--- Log closed Fri Mar 13 00:00:16 2009
code logs -> 2009 -> Thu, 12 Mar 2009< code.20090311.log - code.20090313.log >