code logs -> 2012 -> Mon, 16 Apr 2012< code.20120415.log - code.20120417.log >
--- Log opened Mon Apr 16 00:00:15 2012
00:07
<&McMartin>
OK
00:08
<&McMartin>
Goal for the day: Have my compiler be able to compile Hello World.
00:08
<~Vornicus>
AMBITION
00:32 You're now known as TheWatcher[T-2]
00:35 * TheWatcher[T-2] looks at some code he wrote about 11 months ago, is shocked to find that it isn't utter shit
00:35
<&McMartin>
Wheover that fellow was was surely a sharp young lad.
00:35
<&McMartin>
(You six months ago is someone else, right~)
00:36
<@TheWatcher[T-2]>
(Clearly~)
00:36 You're now known as TheWatcher[zZzZ]
00:41
< sshine>
McMartin, for what language is your compiler?
00:55
<&McMartin>
sshine: A subset of Pascal; the goal is to automate the tedious bits of assembly programming for the 8-bit chip series including the C64 and NES.
00:55 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
00:55 mode/#code [+o Syloq] by ChanServ
00:56 Syloq is now known as Syloq_Home
01:00
< Noah>
sshine: Fun Fact: McMartin is on IRC right now with a C64
01:00
<&McMartin>
Actually, I haven't re-installed VICE on this machine since I upgraded it
01:01 Serah [Z@Nightstar-5aa18eaf.balk.dk] has quit [Ping timeout: 121 seconds]
01:31 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
01:42
< sshine>
in Drupal, making a cache directory globally writeable can cause the stylesheet not to load.
02:09
<&McMartin>
Carlsbad:caml mmartin$ ./TestQuad ../tests/test1.pas
02:09
<&McMartin>
WStr "HELLO, WORLD!"
02:09
<&McMartin>
WNl
02:09
<&McMartin>
(Thanks to read/readln/write/writeln all ahveing special calling conventions applying only to them, they get their own primitives in the intermediate language.)
02:16 Kindamoody[zZz] is now known as Kindamoody
02:32
< Noah>
McMartin: Yay! (I think.)
02:52
<&Derakon>
Can anyone recall if there's a standard structure in Python that lets you access a dictionary via foo.bar instead of foo['bar']?
02:53
<@rms>
| __getattribute__(...)
02:53
<@rms>
| x.__getattribute__('name') <==> x.name
02:53
<&Derakon>
Ah.
02:54
<&Derakon>
Though, thinking about this more I think I'll just make an explicit class for this particular problem.
02:55
< Rhamphoryncus>
Derakon: that's the standard procedure
02:57
< Noah>
Derakon: Seems like I've read something about doing that before
02:59
< Noah>
http://code.activestate.com/recipes/473786-dictionary-with-attribute-style-acces s/
03:01 * Derakon moves on to trying to figure out the best way to parse the "A+XdYMZ" thing.
03:01
<&Derakon>
A is optional, but if present it is followed by a +.
03:01
<&Derakon>
XdY is optional, but if present X is also optional. ._.
03:01
<&Derakon>
MZ is optional, but the M is always present if the Z is.
03:02
<&Derakon>
IOW + and M are delimiters.
03:02
<&Derakon>
So I can use a series of split operations, I guess.
03:02
<&Derakon>
Would using a regex really be better?
03:06
< Noah>
Well, supposedly regex is really powerful for things like that
03:06
< Noah>
However, I can't regex for the life of me
03:08
<&McMartin>
Are A and X basically the same thing?
03:09
<&McMartin>
I'd go with a split and then operate on it a token at a time.
03:09
<&Derakon>
A is a constant offset. X is the number of dice to roll. Y is the die size. Z is a weighted offset depending on external factors.
03:09
<&McMartin>
So, they're all numbers.
03:09
<&Derakon>
Yes.
03:09
<&McMartin>
+, d, and M are your delimiters; split on them and keep them around.
03:10
<&McMartin>
You can probably just do a series of length and "is this this delimiter" checks instead of making a crazy parser state machine.
03:11
<&Derakon>
Length? Like, length of the result from split()?+
03:11
<&Derakon>
s/+//
03:12
<&McMartin>
yeah
03:13
<&McMartin>
There's no reason to go "OK, first we expect a number or 'd'. If it's a number, that's either A or X, so cache that and see if the next one is '+'..."
03:13
<~Vornicus>
rOne moment
03:14
<&Derakon>
Okay, I believe I have this working properly with split.
03:16
<@ToxicFrog>
Derakon: what are A and X and Y and M and Z actually?
03:16
<&McMartin>
Yeah, I can build some LL(1) parse tables for that, but just because I *can* doesn't mean I *should*
03:16
<&Derakon>
M is just a delimiter. The rest are ints.
03:16
<&McMartin>
+, d, and M are literals
03:16
<&Derakon>
X and Y are number of dice and die size. A is a constant modifier. Z is a scaled modifier (scaled with depth in the dungeon)
03:17
<@ToxicFrog>
I actually meant "what do they mean"
03:17
<@ToxicFrog>
Ok.
03:17
<&Derakon>
They're used to calculate bonuses on objects.
03:17
<&Derakon>
So e.g. a Ring of Prowess increases the power of your melee strikes by 20+20M80.
03:17
<@ToxicFrog>
(I usually see XdY + K; M is completely unfamiliar to me
03:17
<&Derakon>
Er, 20+d20M80
03:18
<&Derakon>
Which means you get from +40 to +120 to your power, depending on a die roll and your dungeon depth.
03:18
<&Derakon>
...+21 to +120.
03:18
<&Derakon>
Sorry, I can't brain.
03:18
< Noah>
You fail at brain.
03:20
< Noah>
M80 is what exactly?
03:20
<&Derakon>
A value that ranges from 0 to 80 depending on depth in the dungeon.
03:20
< Noah>
Yea, but how is it affect the dice roll?
03:20
<&Derakon>
It's added to it.
03:20
< Noah>
Directly?
03:20
<&Derakon>
Yes.
03:21
<&McMartin>
The M is for "modifier", presumably
03:21
< Noah>
So, 20+(d20+DLVL)?
03:22
<&McMartin>
No, because there might not be 80 DLVLs.
03:22
<~Vornicus>
pattern = re.compile(r"(?:(?P<offset>\d+)\+)?(?P<dice>\d+)?d(?P<size>\d+)(?:M(?P<weight>\d +))?")
03:22
<~Vornicus>
Yeah so, re is kind of crunchy.
03:22
<@ToxicFrog>
o.O
03:22
< Noah>
Oh, so the dungeon level itself isn't the M(#) part?
03:23
< Noah>
Is it linear?
03:23
<&Derakon>
No. http://pastebin.com/CzZjQVpm
03:24
<&Derakon>
"N" is the dungeon level; the other columns show how frequently that bonus was selected for that dungeon level.
03:24
<&Derakon>
Thus, at dungeon level 128 (the max), the maximum bonus possible in this case (10) was selected 64.07% of the time.
03:25 * Vornicus wonders if TF is o.Oing at the regex.
03:25
<&Derakon>
I know I did!
03:26
< Noah>
Okay, so the bonus ranges from 0-10?
03:26
<@ToxicFrog>
Vornicus: yes
03:26
<@ToxicFrog>
That seems...excessive
03:27
<@ToxicFrog>
/(\d+\+)?((\d+)?d(\d+))?(M\d+)?
03:27
<~Vornicus>
(?:(\d+)\+)?(\d+)?d(\d+)(?:M(\d+))? is what it is really
03:28
<~Vornicus>
the ?P<offset> and the like tag the match groups so you can address them by name.
03:28
<&Derakon>
Noah: in that case it does.
03:28
<&Derakon>
That'd be the range for an M10 item.
03:28
< Noah>
Ah
03:28
<&Derakon>
If it were M80 then the bonus would range from 0 to 80.
03:29
<~Vornicus>
This gives you strings with plain numbersin them if they're available and None if they don't exist.
03:30
<@Alek>
hrm.
03:30
<@Alek>
so 2+2d4 M8 would be 12 to 18?
03:30
<&Derakon>
No.
03:30
<&Derakon>
The minimum output from 2d4 is 2.
03:30
<@Alek>
I'm confused. sorry.
03:31
<~Vornicus>
well, it's be 4 to 10 if you meet it on the first dungeon level
03:31
<&Derakon>
Thus the minimum possible is 2 + 2 + 0.
03:31
<&Derakon>
The maximum would be 2 + 8 + 8.
03:31
<@Alek>
mmmh.
03:31
<~Vornicus>
But it could be 12 to 18 if you get it deeper into the dungeon.
03:31 Eri [Eri@Nightstar-3e5deec3.gv.shawcable.net] has joined #code
03:31
<&Derakon>
Even deeper in the dungeon, the M modifier can still return 0.
03:32
<&Derakon>
So if all you care about is the range, not the distribution, you should read "M8" as "1d9 - 1".
03:32
<@Alek>
so basically, it's 2+2d4+(d9-1) effectively?
03:32
<@Alek>
heh.
03:32
<&Derakon>
Except it's not because the distribution is absolutely not flat.
03:32
<@Alek>
mmm.
03:32
<&Derakon>
Per the table I posted earlier.
03:33
< Noah>
Derakon: Would it not be easier to have a base number and do a + or - do it based on a role?
03:33
<@Alek>
you know, there's probably combinations of dice and modifiers that fit any given distribution. just gotta find them.
03:34
< Noah>
roll*
03:34
<&Derakon>
The goal here is to introduce a depth-dependent modifier to the quality of items.
03:34
<&Derakon>
You can't do that with just dice.
03:34
< Noah>
Hmm
03:50 cpux|2 [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
03:52 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
04:17 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
04:35 Vash [Vash@Nightstar-fb5b40e5.wlfrct.sbcglobal.net] has joined #code
04:35 mode/#code [+o Vash] by ChanServ
04:47
<&Derakon>
Hm, this is getting ugly. Stupid optional values in the serialization.
04:48
<&Derakon>
For example, the "armor" entry in the serialization has an optional "armorBonus" field which can take the aforementioned format.
04:49
<&Derakon>
So when I create an armor Item, I want to check if there is an armorBonus field, and convert it into something I can work with more easily.
04:49
<&Derakon>
So it's like "if self.armor: if 'armorBonus' in self.armor: self.armor['armorBonus'] = parseBonus(self.armor['armorBonus']"
04:50
<&Derakon>
The general form is "There's an optional field named Bar in this dict Foo; create a Baz from it if it exists, or a dummy Baz if it doesn't."
04:51 eckse [eckse@Nightstar-d9cc4185.dsl.sentex.ca] has quit [Client closed the connection]
04:59
< Noah>
Derakon: sounds painful
05:05
<~Vornicus>
Time for the refactor tractor.
05:06
< Noah>
Vroom vroom
05:06
<&Derakon>
Does it count as refactoring if this is the first time you're writing the code?
05:06
<~Vornicus>
Yes.
05:13 * Derakon implements the getAmRelevant() method for a few classes.
05:13
<&Derakon>
There to indicate that the class could actually materially affect the game if it were used.
05:13
<&Derakon>
(These classes contain various item stats; if the stats are all 0 then the class is not relevant)
05:19
<&Derakon>
Helpful thing to keep in mind: the get() method on dicts.
05:20
<&Derakon>
foo.get(key, defaultValueIfKeyNotPresent)
05:31 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has quit [Client exited]
05:53 * Derakon solves a bug that turned out to be due to him twice failing to remember to return a value having calculated it, thus resulting in functions whose return values were always None.
05:53 Kindamoody is now known as Kindamoody|out
06:20 Vash [Vash@Nightstar-fb5b40e5.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
06:25
< Noah>
Heh
06:30 Derakon is now known as Derakon[AFK]
07:24 Noah [noah@Nightstar-b8b9786c.pools.spcsdns.net] has quit [[NS] Quit: Leaving.]
07:26 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
07:26 Noah [noah@Nightstar-b8b9786c.pools.spcsdns.net] has joined #code
07:35 himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds]
09:43 You're now known as TheWatcher
09:56 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
09:56 mode/#code [+o himi] by ChanServ
12:57
< gnolam>
https://github.com/blog/1103-ten-years-of-farbrausch-productions-on-github
13:07
<@TheWatcher>
... holyshit
13:12
<@TheWatcher>
And they public domained it, what.
13:12 * TheWatcher grabs
13:13
<@TheWatcher>
oh, okay, not all PD, some is BSD O.o
13:33 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
14:16
<@ToxicFrog>
Probably a better choice, really
14:48
<@TheWatcher>
Either way, I know that this evening I'm going to be pulling them apart to see how they've done some stuff ¬¬
15:12 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has joined #code
15:59 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
16:24 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
17:10 Stalker [Z@Nightstar-5aa18eaf.balk.dk] has joined #code
17:30 Attilla [Obsolete@Nightstar-d1137b23.as43234.net] has joined #code
17:54 Vash [Vash@Nightstar-fb5b40e5.wlfrct.sbcglobal.net] has joined #code
17:54 mode/#code [+o Vash] by ChanServ
18:08 Kindamoody|out is now known as Kindamoody
18:23 Syloq_Home [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
18:29 cpux|2 [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
18:30 Syloq_Home [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
18:40 * gnolam woots!
18:40
< gnolam>
Looks like I won't be starving this summer either.
18:44
<@TheWatcher>
\o/
18:47
< gnolam>
Internal radioactive contamination FTW.
19:11 Vornucopia [NSwebIRC@C888DE.7F9621.4A1301.BBBE7B] has joined #code
19:12 Kindamoody is now known as Kindamoody[zZz]
19:51 Attilla [Obsolete@Nightstar-d1137b23.as43234.net] has quit [[NS] Quit: ]
20:04 Attilla [Obsolete@Nightstar-7678f774.threembb.co.uk] has joined #code
21:23 * McMartin has a sinking feeling most of the fun bits of werkkzeug are going to be "calls to system internals" and thus seriously damaging the "in 96kb" claims
21:24
<&McMartin>
It's still a major achievement, but the bullshit being slung on the internet in the early 2000s doesn't hold up~
21:54 Vornucopia [NSwebIRC@C888DE.7F9621.4A1301.BBBE7B] has quit [[NS] Quit: Page closed]
21:57 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
22:22 Vash is now known as Vash[AFK]
22:25 Serah [Z@Nightstar-5aa18eaf.balk.dk] has joined #code
22:25 Noah1 [noah@Nightstar-9b41dd51.pools.spcsdns.net] has joined #code
22:25 Noah [noah@Nightstar-b8b9786c.pools.spcsdns.net] has quit [Ping timeout: 121 seconds]
22:26 Stalker [Z@Nightstar-5aa18eaf.balk.dk] has quit [Ping timeout: 121 seconds]
22:30 * ToxicFrog stabs Seagate in the face a few times
22:30
< gnolam>
HD crash?
22:33
< Noah1>
Farbrausch's Debris demo is 177KB of trippy
22:33 Noah1 is now known as Noah
22:46
<@ToxicFrog>
gnolam: no, I'm trying to reconstruct my USB Stick Full Of Useful Tools
22:46
<@ToxicFrog>
Which includes Seatools, because it's actually a decent HDD diagnostic thinger
22:46
<@ToxicFrog>
Except god forbid they make it available as a floppy image
22:46
<@ToxicFrog>
No, you need to download the installer for the floppy version and rip the image out of it with a hex editor
22:59 Vash[AFK] [Vash@Nightstar-fb5b40e5.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
23:01
< Noah>
Write them an angry letter
23:02
< Noah>
I mean "aggressively worded"
23:20 Serah [Z@Nightstar-5aa18eaf.balk.dk] has quit [Ping timeout: 121 seconds]
23:22 Attilla_ [Obsolete@Nightstar-d1137b23.as43234.net] has joined #code
23:24 Attilla [Obsolete@Nightstar-7678f774.threembb.co.uk] has quit [Ping timeout: 121 seconds]
23:24 himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code
23:24 mode/#code [+o himi] by ChanServ
23:26 Attilla_ is now known as Attilla
--- Log closed Tue Apr 17 00:00:30 2012
code logs -> 2012 -> Mon, 16 Apr 2012< code.20120415.log - code.20120417.log >

[ Latest log file ]