code logs -> 2010 -> Sat, 02 Oct 2010< code.20101001.log - code.20101003.log >
--- Log opened Sat Oct 02 00:00:01 2010
00:00
< celticminstrel>
But is it available for Mac? As I recall, it's not.
00:02
< ToxicFrog>
Pretty sure it's windows-only.
00:02
< ToxicFrog>
So, if you don't care about in-browser play or portability.
00:02 shade_of_cpux is now known as cpux
00:03
< celticminstrel>
And I definitely care about portability.
00:04
<@McMartin>
Yeah, and apparently portability costs $225
00:04
< celticminstrel>
Huh?
00:04
<@McMartin>
The difference in cost between a flash devkit and the pro version of GM8 is ~$225.
00:05
<@McMartin>
ISTR Spelunky didn't work in Wine, but I don't know if it's been tried in POL, and I have no idea if anyone tried Iji.
00:07
<@McMartin>
And both of those use extension DLLs.
00:07
<@McMartin>
I'm not sure if stock-engine game would work or not.
00:08
< ToxicFrog>
I tried Iji in POL, and it did work (at least as far as the main menu)
00:08
< ToxicFrog>
I didn't actually try it in game because just going from the readme I'm going to need a gamepad and/or a key remapper to play it.
00:09 Rhamphoryncus [rhamph@Nightstar-473f8685.abhsia.telus.net] has joined #code
00:09
< celticminstrel>
I seem to recall trying a Game Maker game in WINE. It ran, but in an unplayable manner.
00:10
<@McMartin>
I *strongly* suspect, given the performance I see in Win7, that whether or not the game is using D3D will matter.
00:26 Orthia [orthianz@Nightstar-7c5d5f66.xnet.co.nz] has joined #code
00:30 You're now known as TheWatcher[T-2]
00:37 You're now known as TheWatcher[zZzZ]
00:57 Orthia [orthianz@Nightstar-7c5d5f66.xnet.co.nz] has quit [Connection reset by peer]
01:11 Orthia [orthianz@Nightstar-7c5d5f66.xnet.co.nz] has joined #code
01:25 Derakon[AFK] is now known as Derakon
02:22 Derakon is now known as Derakon[AFK]
03:07
<@Vornicus>
Kaura!
03:07
<@Vornicus>
Write a help string for your program!
03:11 Orthia [orthianz@Nightstar-7c5d5f66.xnet.co.nz] has quit [Client closed the connection]
03:12
< kaura>
Vorn: Will do! Soon as I get more curry and soy milk.
03:20 Orthia [orthianz@Nightstar-7c5d5f66.xnet.co.nz] has joined #code
03:40 Orthia [orthianz@Nightstar-7c5d5f66.xnet.co.nz] has quit [Client closed the connection]
04:03 Orthia [orthianz@Nightstar-7c5d5f66.xnet.co.nz] has joined #code
04:03 Orthia [orthianz@Nightstar-7c5d5f66.xnet.co.nz] has quit [Client closed the connection]
04:15
< kaura>
Okay, so I went a bit ahead... >_>;; http://pastebin.starforge.co.uk/392
04:19 Orthia [orthianz@Nightstar-7c5d5f66.xnet.co.nz] has joined #code
04:24
< kaura>
And just now I appended "print programhelp()" before "def command():" so that it'll come up once at the beginning...
04:28
<@Vornicus>
kaura: programhelp() should use return.
04:29
< kaura>
Ah-hah. True.
04:30 celticminstrel [celticminst@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
04:32
<@Vornicus>
Also, technically you don't need two functions here.
04:33
< kaura>
Oh, I suppose not. Could just replace user_help with programhelp
04:33
<@Vornicus>
I separated them earlier because we have the "model" - the stuff that handles data - and the "view/controller delegate" - the stuff that talks to the user - separate that way.
04:35
<@Vornicus>
Since the help thing doesn't touch any data, it only needs the delegate functino.
04:36
< kaura>
Right.
04:39
<@Vornicus>
This is a very important separation.
04:40
< kaura>
Stuff that actually does something with data versus stuff that's mostly cosmetic is probably a rather important distinction, yes~
04:40
<@Vornicus>
It means that, if we really felt like it, we could take the entire thing of deck-handling and put it into a different module and use it in an entirely different program... and not have to rewrite code in any significant fashion.
04:54
<@Vornicus>
Which actually we should do pretty soon.
04:55
< kaura>
?
05:02
<@Vornicus>
Move the deck handling into a different module -- and in fact into a clas.
05:03
< kaura>
Into a class?
05:05 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code
05:17 TarinakyKai [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code
05:17 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Ping timeout: 121 seconds]
05:19 TarinakyKai [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Client closed the connection]
05:27 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code
05:27
<@Vornicus>
Yes.
05:27
<@Vornicus>
And if I werent' doing stuff I'd be explaining it now.
05:28
< kaura>
Carry on. The deck simulator can wait.
05:30
< Tarinaky>
That was odd. I left the computer to go get a snack, when I came back - my sound glitched out and then the PC rebooted. Upon restart my mouse was not responding. Another restart later it worked again o.o
05:35
< Tarinaky>
Hmm. gmpc is complaining about a missing libmpc.so.0 now.
05:38
< Tarinaky>
My package manager is informing me that said lib never existed.
05:41
< Tarinaky>
Looking at it, in fact, I'm pretty certain the GUI for gmpc has changed subtly.
05:53 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Connection closed]
05:58 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code
06:05 Anno[Laptop] [annodomini@Nightstar-94d896c8.adsl.tpnet.pl] has joined #code
06:10 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Connection closed]
06:12
<@Vornicus>
Hokayso.
06:13 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code
06:21
<@Vornicus>
Kaura: building a class really isn't all that hard. But since we've put it off this long it will be a bit of a pain with all the renaming.
06:23
< kaura>
Whee~
06:24 * Anno[Laptop] hates.
06:25
< Anno[Laptop]>
Every time my parents bring me this clock, saying, "program this, mister programmer", I waste at least twenty minutes trying to figure out how to set the goddamn time.
06:26
< Anno[Laptop]>
It was not designed by humans, but some aliens with unknowable motivations and propensity towards installing fuctions nobody will use rather than making it easy for someone to set the time. Or turn off the alarm (which can only be done by a hard reset, in my experience).
06:27
< Anno[Laptop]>
There are six buttons on the thing. SET, ALARM, MODE, C/F, UP, DOWN.
06:27
< Anno[Laptop]>
SET and C/F have the identical function of changing the thermometer display from Celsius to Fahrenheit and back, in base mode.
06:29
< Anno[Laptop]>
Pressing MODE once brings me to changing the type of hour system, 12 Hour or 24 Hour. Pressing it again brings me to the ALARM setting screen. Pressing it again brings me to something that superfically resembles the time-setting mode, except this one only take some preprogrammed time and never moves from there or affects the normal clock at all.
06:30
< Anno[Laptop]>
Pressing it again brings me to a stopper timer. WHO USES THIS SHIT IN A PICTURE-FRAME ALARM CLOCK?
06:30
< Anno[Laptop]>
It turns out that the hour type mode is only a prelude to setting the time, you have to select the hour type, and then press SET to get to where you can modify current time.
06:31
< Alek>
hm.
06:31
< Anno[Laptop]>
I say this here because I'm angry, and because I may need it again.
06:31
< Alek>
is it a digital picture frame or just regular?
06:31
< Tarinaky>
Reminds me of Thursdays game of Traveller where we spent an hour working out how to operate an Alien lift.
06:32
< Anno[Laptop]>
Regular picture frame. For a deadtree picture.
06:32
< Tarinaky>
When we had to get out of there in a hurry they were damn grateful of the time spent!
06:32
< Alek>
tried seeing what the other buttons do on the "preprogrammed time" setting?
06:33
< Alek>
it might be some function.
06:33
< Alek>
also. got a model number or something? we could look it up on the webz.
06:33
< Anno[Laptop]>
There is no model. No manufacturer, no nothing. I can imagine their shame at producing such shit, and not wanting to sign in.
06:34
<@Vornicus>
Kaura: so, anyway, start with the line "class Deck(object):
06:34
< Tarinaky>
Next time, sneak to ASDA and buy a new, cheap, alarm clock.
06:34
< Tarinaky>
Claim to have reprogrammed its form into something useable.
06:34
< Anno[Laptop]>
Alek: I already figured out how to do what I want. I do NOT want to touch this again.
06:34
< Alek>
:P
06:35
< Anno[Laptop]>
Tarinaky: Very funny.
06:35
< Tarinaky>
The one my parents got me from ASDA was really good.
06:35
<@Vornicus>
this creates a class called Deck, which inherits its basic behaviour from the "object" class - which is very basic.
06:35
< kaura>
Vorn: Within MTGSimulator.py, or within the new module?
06:35
< Tarinaky>
The only issue was it was easy to press the minute button once too often when you were programming it.
06:35
< Tarinaky>
And then have to press it another 59 times >.<
06:35
<@Vornicus>
For now, within MTGSimulator.py
06:35
< kaura>
k
06:38
< Anno[Laptop]>
Are you guys programming a Magic: the Gathering application of some sort?
06:38
<@Vornicus>
Anno: of some sort. It's more generic than that; it's a thing that simulates a deck of named cards (that it's pulled from a file) and allows you to draw cards, put cards on the top or bottom, search for cards, that sort of thing.
06:39
< kaura>
It's a deck manipulator. That's currently getting fed a MTG decklist. >_>
06:41
<@Vornicus>
Anyway, after that line, indented, put def __init__(self, filename): -- and then place the contents of "load" in there, replacing every instance of "deck" with "self.deck"
06:42
<@Vornicus>
All functions within a class use "self" as the first parameter -- it's a "semi-special" name that stands for "the object that I'm being called on"
06:44
< kaura>
Like so? http://pastebin.starforge.co.uk/393
06:45
<@Vornicus>
Kaura: not quite. The "def load(deck_file):" is /replaced/ by def "__init__(self, deck_file):"
06:46
< kaura>
Ahh, whups. Copy the innards of load(deck_file), not the whole thing in itself.
06:47
<@Vornicus>
Right.
06:47
<@Vornicus>
(and yeah, I misnamed that parameter again)
06:53
<@Vornicus>
And while we're in there: don't return the deck (since we don't actually see the return value of __init__; __init__ is the code run when you do Deck("deckfile.txt"), and Python forces a return of the new Deck object)
06:53
< kaura>
Ah, it does? Will keep that in mind.
06:54
<@Vornicus>
And also, self.deck_file = deck_file (this makes it so the Deck object itself knows where to find its original file.)
06:59 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Connection closed]
07:00
<@Vornicus>
So what we're doing here, is making an object that keeps track of the deck, and also some other things that are also important.
07:01
<@Vornicus>
When we do one of the Crazy Stunts, we'll be using the ability to keep this data together to make our lives a bit easier.
07:02 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code
07:03
<@Vornicus>
So anyway: now that we've got the init in there, let's pull in all the other deck-manipulation functions. Mostly all you have to do is move them into the class (so they're at the same indentation depth as __init__), replace "deck" in the parameter list with "self", and "deck" in the function body with "self.deck"
07:04
<@Vornicus>
Just checked; this works for all the deck-manipulation functions.
07:04
< kaura>
Right. Lesse...
07:08
< kaura>
Like so? http://pastebin.starforge.co.uk/394
07:09
<@Vornicus>
Yes, but don't forget to indent draw properly. And... how long has that bug been in soft_draw? remove the raise from that.
07:10
< kaura>
Ah, I see what you mean. Yeah, must've forgotten to delete it...
07:10
< kaura>
Right, draw()'s body indented properly now.
07:13
<@Vornicus>
Okay, that's all for creating the class; now we have to modify the view functions to use it, and while we're here, modify the way the first load happens.
07:16
<@Vornicus>
So, the view functions, instead of saying (for instance) topwise(deck, card), say deck.topwise(card). There is a difference though in user_load: instead of saying "deck = load_deck(filename)", say deck = Deck(filename), and remove the two lines that talk about "deck_file" (because we don't need to keep track of it any more: the deck itself will!)
07:18
< kaura>
...that's quite a few changes. Alright.
07:20
<@Vornicus>
It is. But notice what it does: it makes it so that the Deck class keeps track of its own information; it can, then, be used to do more advanced things in a consistent way (we'll see how that works when we get to one of the crazies), and it doesn't take up as much name-space.
07:21
< kaura>
so remove "open(deck_file)" and "for line in open(deck_file):"?
07:23
<@Vornicus>
What
07:23
<@Vornicus>
No, no, this is in user_load
07:23
< kaura>
I was wondering if that sounded right. >_> You said to remove teh two lines that talk about deck_fil- oooooh
07:24
< kaura>
Yeah, I misread your earlier line.
07:29
<@Vornicus>
Anyway once that's all done show me the whole file again.
07:31
< kaura>
...202 lines. Wow. http://pastebin.starforge.co.uk/395
07:32
< kaura>
Well, lots of white space, but.
07:44
<@Vornicus>
Okay, all those things I told you to move into the class definition? Delete the unmoved ones.
07:44
<@Vornicus>
(so, 68-100)
07:47
< kaura>
Done
07:56
< kaura>
..hrn. Midnight already. We'll have to stop here - I need to get up early tomorrow.
07:59
<@Vornicus>
Ok.
07:59
<@Vornicus>
Sorry, I was kinda distracted tonight.
08:01 Derakon[AFK] is now known as Derakon
08:02
< kaura>
No problem.
08:12 Orthia [orthianz@Nightstar-7c5d5f66.xnet.co.nz] has quit [Ping timeout: 121 seconds]
08:29 Derakon is now known as Derakon[AFK]
08:45 Orthia [orthianz@Nightstar-4f6e2184.xnet.co.nz] has joined #code
08:47 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
10:18 Vornicus is now known as Vornicus-Latens
10:20 TarinakyKai [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code
10:23 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Ping timeout: 121 seconds]
10:30 Orthia [orthianz@Nightstar-4f6e2184.xnet.co.nz] has quit [Client closed the connection]
10:36 Orthia [orthianz@Nightstar-4f6e2184.xnet.co.nz] has joined #code
10:36 Orthia [orthianz@Nightstar-4f6e2184.xnet.co.nz] has quit [Connection reset by peer]
10:45 Orthia [orthianz@Nightstar-4f6e2184.xnet.co.nz] has joined #code
10:45 Orthia [orthianz@Nightstar-4f6e2184.xnet.co.nz] has quit [Client closed the connection]
10:53 Orthia [orthianz@Nightstar-4f6e2184.xnet.co.nz] has joined #code
11:19 kaura [kaura@Nightstar-fd82400d.snfc21.sbcglobal.net] has quit [[NS] Quit: HydraIRC -> http://www.hydrairc.com <- Po-ta-to, boil em, mash em, stick em in a stew.]
11:27 Rhamphoryncus [rhamph@Nightstar-473f8685.abhsia.telus.net] has quit [Client exited]
11:28 You're now known as TheWatcher
13:39 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
14:05 Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has quit [Ping timeout: 121 seconds]
14:12 Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has joined #code
14:20 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
14:32 You're now known as TheWatcher[afk]
16:00 Orthia [orthianz@Nightstar-4f6e2184.xnet.co.nz] has quit [Ping timeout: 121 seconds]
17:20 Orthia [orthianz@Nightstar-4f6e2184.xnet.co.nz] has joined #code
18:08 Ortiha [orthianz@Nightstar-349db330.xnet.co.nz] has joined #code
18:11 Orthia [orthianz@Nightstar-4f6e2184.xnet.co.nz] has quit [Ping timeout: 121 seconds]
19:04 Vornicus-Latens is now known as Vornicus
19:04 cpux [chatzilla@Nightstar-c978de34.dyn.optonline.net] has quit [[NS] Quit: ChatZilla 0.9.86 [Firefox 3.6.10/20100914125854]]
19:11 TarinakyKai [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Client closed the connection]
21:10 * ToxicFrog eyes PHP
21:10
< ToxicFrog>
n !<= (n + 1)
21:10
< Namegduf>
What?
21:11
< Namegduf>
Why?
21:16
< ToxicFrog>
Ok, check this shit out
21:16
< ToxicFrog>
n = "A"; while (++n < "Z") print $i;
21:17
< ToxicFrog>
Emits A through Y.
21:17
< ToxicFrog>
(or will if it's cleaned up, that may not be valid PHP as written)
21:17
< Namegduf>
Hmm.
21:17
< Namegduf>
I think you can do that in C.
21:17
< ToxicFrog>
That's expected.
21:17
< ToxicFrog>
n = "A"; while (++n <= "Z") print $i;
21:18
< ToxicFrog>
Emits A through Z, then AA, AB, ..., YY, YZ.
21:18
< Namegduf>
...huh.
21:18
< ToxicFrog>
The reason being that "Z" <= "Z" is true, so it does another loop iteration; then ++"Z" == "AA" because why the fuck not? And "AA" is still <= "Z".
21:19
< Namegduf>
It takes until ZZ to be > Z.
21:19
< Namegduf>
I wonder what their comparison function looks like.
21:25 You're now known as TheWatcher
22:16 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
22:27
<@Vornicus>
The comparison function is the standard alphabetical ordering comparison.
22:28
< celticminstrel>
Lexicographical!
22:31
<@Vornicus>
Yes.
22:32
<@Vornicus>
But yeah. there's some form of drugs involved in incrementing strings /anyway/, and both perl and php use it.
22:34
< celticminstrel>
...incrementing strings?
22:35
< celticminstrel>
Wouldn't strings not be a well-order?
22:40 Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has quit [Ping timeout: 121 seconds]
22:42 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
22:47 Derakon[AFK] is now known as Derakon
22:49
<@Derakon>
Celtic: in Perl, if you try to perform a numerical operation on a string, the string will first be converted into a number.
22:49
<@Derakon>
E.g. "5" + 1 = 6
22:49
< celticminstrel>
I'm trying to figure out how that is relevant.
22:50
<@Derakon>
It allows you to increment a string.
22:50
<@Derakon>
$foo = "5"; $foo++; print "$foo\n";
22:50
< celticminstrel>
Is that what Vornicus was talking about though?
22:50
<@Derakon>
Possibly not!
22:50
<@Derakon>
I didn't bother reading all the way up.
22:50
<@Vornicus>
celmin: that's actually what I was talking about.
22:50
< celticminstrel>
He did mention Perl, so -- okay.
22:50
<@Vornicus>
[16:16:47] <ToxicFrog> n = "A"; while (++n < "Z") print $i;
22:50
<@Vornicus>
[16:17:03] <ToxicFrog> Emits A through Y.
22:51
<@Vornicus>
[16:17:32] <ToxicFrog> n = "A"; while (++n <= "Z") print $i;
22:51
<@Vornicus>
[16:18:07] <ToxicFrog> Emits A through Z, then AA, AB, ..., YY, YZ.
22:52
<@Derakon>
Ah, yes, "A" + 1 = "B" in Perl. I didn't know that.
22:52
<@Derakon>
(But a quick check shows it to be true)
23:00 Derakon is now known as Derakon[AFK]
23:00 Anno[Laptop] [annodomini@Nightstar-94d896c8.adsl.tpnet.pl] has quit [[NS] Quit: Away.]
23:13 Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has joined #code
--- Log closed Sun Oct 03 00:00:02 2010
code logs -> 2010 -> Sat, 02 Oct 2010< code.20101001.log - code.20101003.log >