code logs -> 2010 -> Fri, 24 Sep 2010< code.20100923.log - code.20100925.log >
--- Log opened Fri Sep 24 00:00:51 2010
01:00 Vornicus-Latens is now known as Vornicus
01:07 * Vornicus returns home.
01:46 * Vornicus pokes vaguely at kaura.
02:00 Anno[Laptop] [annodomini@Nightstar-1dbb6eaa.adsl.tpnet.pl] has quit [[NS] Quit: Zzz.]
02:05 Derakon[AFK] is now known as Derakon
02:49 Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [Ping timeout: 121 seconds]
03:26 Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
03:32 Derakon is now known as Derakon[CIV]
03:45
< Tarinaky>
Oh God, that's out now isn't it?
03:45
< Tarinaky>
I was going to ask if anyone knew any OSS game/rpg construction kits - anything that'd let me have something running in 5 to 15 minutes.
03:47
< Tarinaky>
I'll highlight that I'm not looking for 'Good'.
03:48
< Tarinaky>
Just Easy and Free.
03:48
< gnolam>
Tarinaky: http://clintbellanger.net/rpg/ ?
03:50
< Tarinaky>
That... looks more like a complete game than a construction kit.
03:54
< Tarinaky>
Hmm. Actually. Is ALAN any good?
03:56
< Tarinaky>
Or is it not easy?
03:57
< gnolam>
Do not know.
03:57
<@McMartin>
ALAN is terrible.
03:57
<@McMartin>
If you're targeting text games, Inform 7 or TADS 3.
03:58
<@McMartin>
I suggest I7 as we have many experts in it here.
03:58
< Vornicus>
I7 is also a very, very interesting system.
04:01
<@McMartin>
I7 is strictly speaking not open source yet.
04:01
< Tarinaky>
I'm not really targetting anything. I just sorta want something I can play with for an hour and have something working from the get-go.
04:01
<@McMartin>
Yeah, start with I7.
04:01
< Tarinaky>
Exactly what I'm flexible about :x
04:01
<@McMartin>
For action games, http://www.yoyogames.com/gamemaker/ has a pretty full-featured demo version.
04:02
<@McMartin>
I7 does text games in the Zork vein as its intended goal.
04:03
<@McMartin>
http://inform7.com/
04:04
< Vornicus>
by "pretty full featured" I can't think of anything I'd want that it doesn't have, yet.
04:05
<@McMartin>
Lack of nag screens in finished product~
04:06
< Vornicus>
Well, that
04:11
< Tarinaky>
Inform looks really neat.
04:11
< Tarinaky>
Two questions. Is it just nag ware? Is it possible to implement violence?
04:11
<@McMartin>
Inform is not nagware at all.
04:12
<@McMartin>
Inform is not-open-source-yet-because-the-infrastructure-isn't-solid-enough.
04:12
<@McMartin>
Violence can be implemented but is not part of the standard system because RPGs and IF are not *quite* the same thing.
04:12
< Vornicus>
I know that somebody implemented a decent chunk of d20 once.
04:12
<@McMartin>
GM8 is nagware and is *all about* violence.
04:12
<@McMartin>
That somebody was the developer of I7 himself trying to show that it was possible, since he anticipated that people would see it as BABY SYSTEM FOR BABIES.
04:13
< Vornicus>
There is a Rock 'em Sock 'em Robots implementation in Inform 7.
04:13
< Tarinaky>
Infrastructure of what sorry/
04:13
< Vornicus>
The inform 7 backend. It's rather crazy still.
04:13
<@McMartin>
Vornicus: No, that is Inform 6.
04:13
< Vornicus>
Oh.
04:13
< Vornicus>
Well fine.
04:14
<@McMartin>
Tarinaky: The first part of the open-sourcing of I7 was releasing the compiler in which the program could be compiled with.
04:14
< gnolam>
McMartin: wasn't the troll fight in the original Zork sort of random?
04:14
<@McMartin>
gnolam: Sure, but you'll notice the genre moved away from it.
04:14
<@McMartin>
These are real programming languages, you can do whatever in them.
04:14
<@McMartin>
But I7 doesn't *ship* with it.
04:14
<@McMartin>
You have to write your own combat engine.
04:15
< Tarinaky>
Sounds like a fun way to learn the language.
04:15
<@McMartin>
Mmmaybe.
04:15
< Vornicus>
GM8 was used to write (among other things) Spelunky and Iji.
04:15
<@McMartin>
Depends on how you do it
04:15 * gnolam realizes he just referred to something in Zork /for real/. And goes and hides in the closet.
04:16
< Tarinaky>
Don't worry. You can come out of the closet, we won't judge you.
04:16
<@McMartin>
You'd normally start in I7 by setting up maps and objects and such.
04:17
< Tarinaky>
Spawnpoint is a room.
04:17
<@McMartin>
That's a complete I7 program right there~
04:17
< Tarinaky>
Ork Den is East of Spawnpoint.
04:17
<@McMartin>
(GM8 is not for the faint-hearted: you can get Stuff Happening fast, but doing a full RPG game would be quite a bit of work.)
04:17
< Tarinaky>
McMartin: I watched the video tutorial.
04:18
< Vornicus>
How big is FotH, McM?
04:18
<@McMartin>
Um
04:18
<@McMartin>
I'd have to be home to check, and I'm not.
04:18
<@McMartin>
My guesstimate is roughly 30,000 words, though, times or divided by 2.
04:19
< Tarinaky>
Was it one of you guys who made that *-ate game?
04:19
<@McMartin>
That was me; that was Inform 6
04:19
<@McMartin>
I6 is a more traditional C-like language designed to target an unusual binary format.
04:22
< Tarinaky>
LOL. No wonder I couldn't figure out why it wasn't launching. I dled the perl version by accident.
04:22
<@McMartin>
If you have a choice of platform for the IDE, the Mac one is the best by a small margin.
04:23
< Tarinaky>
I don't own a mac.
04:23
<@McMartin>
Fair enough
04:23
<@McMartin>
I haven't used the Linux IDE, just Mac and Windows, but AIUI the IDE advancement is Mac > Windows > Linux at the moment.
04:24
<@McMartin>
(Mac version has superior testing tools integrated.)
04:25 Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Connection reset by peer]
04:26 Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
04:31
< Tarinaky>
How would you set up messages that only appear the first time you're in a room?
04:31
< Tarinaky>
For example a hardboiled monologue.
04:33
< Vornicus>
Probably? "The first time the player enters the gazebo, say..."
04:37
<@McMartin>
That tends to happen just before you enter, though.
04:37
<@McMartin>
Depending on how you do it, the easiest way is to have the room description have "[if unvisited]" clauses.
04:38
<@McMartin>
If you want it to be more complicated, like, for instance, Vorn's cameo in my short game Faett Tiw, having a non-recurring scene that begins when play begins and ends when the location is the room in question.
04:39
<@McMartin>
And then a "when scene X ends: say "yadda"" thing.
04:39
<@McMartin>
You can try to dick around with the implicit LOOK action, but players can dick around back
04:42
< Tarinaky>
If the Basement Cell is unvisited "You awaken in a dark room. A fluorescent tube runs overhead and metal tables line the walls, reflecting the ugly light. You don't remember how you came to be here - simply the man following you. A tape player stirs to life in the middle of the room." ?
04:42
< Tarinaky>
This doesn't compile as is.
04:42
<@McMartin>
No.
04:42
<@McMartin>
It would be
04:43
<@McMartin>
The Basement Cell is a room. "[if unvisited]You awaken etc. etc. etc[otherwise]Here you are back in the basement cell."
04:43
<@McMartin>
Er
04:43
<@McMartin>
The Basement Cell is a room. "[if unvisited]You awaken etc. etc. etc[otherwise]Here you are back in the basement cell.[end if]"
04:43
< Tarinaky>
Ahhh.
04:44
< Tarinaky>
I think I just made it fall over by trying to cut.
04:46 * Vornicus pokes at Kaura.
04:47
< Tarinaky>
How do I add an action to say... play a dictaphone or tape player?
04:47
< Tarinaky>
The documentation only gives examples of modifying existing verbs.
04:47
< Tarinaky>
Not adding new ones.
04:48
< Vornicus>
"understand" I think is the word you want.
04:48
< Tarinaky>
Trying to search to see if use is a builtin but the program's spinning its wheels/using up all my processor :/
04:49
<@McMartin>
Generally, you need to get a minimal build in first and then move on to study the Index tab.
04:49
< Vornicus>
"use" is not a standard verb.
04:49
<@McMartin>
I think you have unrealistic expectations for how quickly you can get fully off the ground, though.
04:50
< Tarinaky>
A minimal build?
04:50
<@McMartin>
New Actions is section 12.7 in the documentation
04:50
<@McMartin>
As in, something small that still compiles and can be run
04:50
< Tarinaky>
I made a room and populated it with things.
04:50
< Tarinaky>
:x
04:50
<@McMartin>
That's enough
04:50
<@McMartin>
As long as it can run.
04:51
<@McMartin>
That will let you "rebuild index"
04:51
< Tarinaky>
It ran. Then I started making it more complicated.
04:51
< Vornicus>
My first Inform 7 program had 6 rooms, 4 objects, and an actual damn puzzle.
04:51
<@McMartin>
If it's ever run you can open the Index tab and see stuff imported from the library.
04:51
< Ortiha>
Vorn: And you knew what you were doing pretty well.
04:52
< Vornicus>
Considering I'd never written a game before in my life and needed McM to give me an idea? I think I did pretty well.
04:52
<@McMartin>
Ow
04:52 * McMartin splits his lip on his laptop monitor trying to close it.
04:52 * McMartin goes to apply first aid and then go home.
04:52
< Vornicus>
...This series of events is befuddling to me.
04:53
<@McMartin>
It was in my lap, and I started standing and closing simultaneously and punched myself in the face with the top bit.
04:53
<@McMartin>
It's been That Kind Of Day.
04:54
< Vornicus>
I see this.
05:00
< gnolam>
McMartin: ...
05:06 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?]
05:07
< Tarinaky>
>.< I tried following one of the worked examples in the documentation (admittedly altered from a lamp to a tape player) and can't seem to figure out why it's not doing what I want :/
05:08
< Tarinaky>
A tape player is in the Basement Cell. Carry out switching on a tape player: say "One two, one two."
05:09
< Tarinaky>
I get "That's not something you can switch."
05:12
< Tarinaky>
Oh. Derp.
05:12
< Tarinaky>
^^ im an idiot.
05:13
<@ToxicFrog>
You need to make it switchable (if that's a defined property) or add a check-rule.
05:15
< Vornicus>
All right, so, Kaura: Earlier I asked you create a list of operations you'd like to be able to perform on your deck. Note that these should probably be pretty generic: drawing some number of cards, locating a particular card in the deck and removing it, that sort of thing.
05:16
< kaura>
Hm. A draw() function should be fairly simple.
05:16
< kaura>
Well, specifically, draw(number)
05:16
< Vornicus>
We want several here.
05:16
< kaura>
Aye, that we do.
05:16
< Vornicus>
draw(deck, number)
05:17
< kaura>
Ah, right.
05:17
< Vornicus>
Several operations, that is, because the culmination of this program is one of the things I found /fucking amazing/ when I did it the first time, after working in more limited settings.
05:17
< kaura>
Heh.
05:18
< Tarinaky>
Gah. Can't figure out how to do multiple line instructions. I want it to do more than one thing when I switch it on.
05:20
<@ToxicFrog>
Tarinaky: do the first thing; do the second thing; do the last thing.
05:20
< Vornicus>
But before we even write these functions, we want to know what operations there are.
05:21
< kaura>
For the first function, draw(x), it should print the first x cards of the deck. The deck, using yesterday's function, should already load up pre-shuffled.
05:22
< kaura>
er, draw(deck, x)
05:22
< Vornicus>
Actually we'll be doing this from an already loaded deck which we'll pass in.
05:22
<@ToxicFrog>
Tarinaky: I suggest keeping WWI, TRB, and the Complete Examples close at hand.
05:23
<@ToxicFrog>
I found reading the source code for Bronze to quite instructive.
05:23
< Tarinaky>
I don't know what those acronyms mean.
05:24
<@ToxicFrog>
Writing With Inform and The Recipe Book
05:24
<@ToxicFrog>
http://inform7.com/learn/manuals/
05:24
<@ToxicFrog>
http://inform7.com/learn/complete-examples/
05:25
< kaura>
Vorn: Ah, so simply tell it to draw from load_deck()?
05:25
< Vornicus>
No, no
05:25
< Tarinaky>
I'm trying to figure out how I can make a tape player give a monologue/spiel over several turns.
05:26
< kaura>
Hrn.
05:26
< Vornicus>
The other way around: draw should be completely separate from load_deck(), so that we don't load a fresh deck each time we draw.
05:26
< Tarinaky>
I guess by extension that'd apply to characters too.
05:26
< kaura>
Ahh.
05:26
<@ToxicFrog>
Tarinaky: http://inform7.com/learn/man/Rdoc18.html
05:27
< kaura>
So what we need draw() to do is... clone a separate deck?
05:27
< Vornicus>
No!
05:27 * kaura headdesks
05:27
< Vornicus>
What we need draw to do is /mangle the existing deck/
05:28
< Vornicus>
So that the next time we draw we're drawing, well, additional cards.
05:29
< kaura>
...alright, think I get it. Thinking it in form of the physically equivalent action. It takes cards out of the existing deck, and puts together a separate list equal to the number of cards you requested.
05:29
< Vornicus>
Right.
05:30
< kaura>
So the operation is to... copy the cards over to the second list, then delete it from the first?
05:30
< Vornicus>
Sort of.
05:31
< Vornicus>
There's a function that we'll be using for draw: pop()
05:31
< Vornicus>
actually that's a method on lists.
05:31
< kaura>
Ah, it "pops" out part of the list?
05:33
< Vornicus>
Yes: it removes one item from the list, and returns it.
05:34
< Vornicus>
http://docs.python.org/library/stdtypes.html#mutable-sequence-types
05:34 * kaura checks wiki. Ah. list.pop(0) returns the first entry, and changes list to exclude the first entry thereafter.
05:34
< Vornicus>
Right. list.pop() as is returns the last entry, etc etc.
05:37
< Vornicus>
Anyway, list comprehensions will help you here.
05:39
< kaura>
Right, something like hand = [x for x in list.pop(x-1)], I think? x-1 because for Python, 0 draws the first card, but the user'll be using a positive integer...
05:40
< kaura>
...no, not quite right.
05:41
< Vornicus>
deck.pop() /is/ something; we want to pop 7 times if we say draw(deck, 7)
05:42
< Vornicus>
And you do not have to give pop a number to get something.
05:42
< kaura>
Ah.
05:43
< Vornicus>
(which is actually something we'll use to our advantage)
05:49
< Vornicus>
So, 1. how do we do something some number of times in a list comprehension?
05:49
< kaura>
Using a for loop, of course.
05:50
< Vornicus>
Let's try that again.
05:50
< Vornicus>
How do we do something /some specific number of times/, as opposed to doing it till we run out of stuff?
05:50
< kaura>
...hm.
05:50
< kaura>
range.
05:51
< Tarinaky>
Hmm. The problem is. If I turn the tape player off, and then turn it back on... it doesn't resume the event.
05:51
< Tarinaky>
The scene rather.
05:51
< Vornicus>
Range. And we can use range in listcomps the same way we use it in for loops.
05:51
< Vornicus>
Have the tape player have a counter on it.
05:52
< Tarinaky>
Vornicus: ?
05:53
< Vornicus>
So that when the tape player is playing, it will say something and then increase the counter.
05:54
< Vornicus>
This also makes it possible to add "fast forward" and "rewind"
05:54
< Tarinaky>
I'm... not sure how to make the tape player spout a line every turn while turned on.
05:55
<@ToxicFrog>
See the example I gave for how to do something every turn.
05:55 * Vornicus would have to read the documentation and do the examples.
05:55
< Vornicus>
Kaura: okay, so where do you put range to make the list comprehension pick up some number of things?
05:55
<@ToxicFrog>
Use something like "Every turn while the tape player is switched on"
05:56
<@ToxicFrog>
And then adapt it to adjust an internal counter rather than clearing entries in the table.
05:57
< Tarinaky>
Every turn while tape player is switched on say "The tape player is on." yields: . The sentence 'Every turn while tape player is switched on say "The tape player is on."' seems to be talking about a previously unknown room or thing called Every turn while tape player. Ordinarily, I would create this, but because the name contains the word 'when' or 'while' I'm going say no.
05:57
< kaura>
Vorn: Going through my previous programs to remember. ...really annoyed that I'm stumped on something I already covered. =/
05:58
< Vornicus>
This is something you did in this file, I think.
06:00
< Tarinaky>
Ahah!
06:00
< Tarinaky>
Got it.
06:01
< Tarinaky>
I wanted Every turn while tape player is switched on: say "The tape player is on."
06:02
<@McMartin>
You might also want to check if the tape player is visible.
06:03
< kaura>
...hrn. Here's what I have so far. Ain't working, though. "hand = [deck.pop() for deck in range(hand)]"
06:03
< kaura>
Oh, wait, I think I skipped a step.
06:04
< Vornicus>
for k in range(x)
06:06
< Vornicus>
remember: x is the number of things you want; you need a brand new iteration value too, and k is useful for that.
06:07
< kaura>
Ooh, right.
06:07
<@ToxicFrog>
Vornicus: what is python convention for ignored-variables, any87ways7
06:07
< kaura>
...hrn. global var 'x' undefined.
06:08
< Vornicus>
"ignored-variables"?
06:08
< kaura>
er, global name
06:08
< Vornicus>
kaura: x, or whatever you put into your draw function's parameter list.
06:08
<@ToxicFrog>
kaura: don't just copy code without understanding it :P the x was a placeholder
06:08
< Vornicus>
Which last I saw was x.
06:08
<@ToxicFrog>
Vornicus: "I need to store this somewhere, but I don't actually care what it is"
06:08
<@ToxicFrog>
Eg, what you're using k for there.
06:08
< Vornicus>
I just use k. It doesn't complain.
06:09
<@ToxicFrog>
Yes, but is there a general Python convention for this? Or is it not common enough for a convention to develop?
06:09
< Vornicus>
I don't know if there is.
06:10
< kaura>
TF: Caught it, actually, and changed. Only problem now is that testing generates a blank line. Well, no red - must be getting closer.
06:11
< Vornicus>
Don't forget to return that thing you just made.
06:11
< Tarinaky>
Checking for visibility seems to be causing problems :/
06:11
< Tarinaky>
A tape player is a switched on device in Basement Cell. Every turn while tape player is switched on and visible: say "Nothing"
06:12
<@McMartin>
Hm. Now that you mention it, "visible" isn't a trait like that.
06:12 * McMartin checks
06:12
<@McMartin>
I think the test will be "and the player can see the tape player"
06:12
< kaura>
Oh, hah. Right, return.
06:12 Derakon[CIV] is now known as Derakon
06:13
< kaura>
Perfect. Generates a string of seven cards.
06:13
< Tarinaky>
Now I need to figure out how to assign a variable to an object. It doesn't seem to be under 'values'.
06:14
< Tarinaky>
Err I mean Numberic.
06:14
< Tarinaky>
Damnit, can't talk.
06:14
<@McMartin>
"A person has a number called hit points. The hit points of a person is usually 10."
06:14
< Tarinaky>
Numbers and Equations.
06:15
<@McMartin>
You probably want to deal with the first 7 chapters of Writing With Inform and have those reasonably internalized, and then skim 8-11, and then pick and choose from there as needed.
06:16
< Tarinaky>
I was going to ask how I then access the tape player's value :/
06:16
<@McMartin>
Oh, is this like an index on the tape player?
06:16
< Tarinaky>
It's err... a bit difficult to just read a manual without well... doing anything with it :/
06:16
< Tarinaky>
Yes.
06:17
<@McMartin>
The tape player has a number called Index, and then you can refer to 'the index of the tape player' anywhere you could need a value.
06:17
< Vornicus>
Kaura: okay, that's one.
06:17
<@McMartin>
As it happens, there are examples that use tables to similar ends and which are less typing for you. Let me find it.
06:17 * kaura ponders
06:17
< Tarinaky>
Ahah.
06:17
< Vornicus>
Now we need to do something that will (say) search the deck for something and remove it -- or tell us if it's not there.
06:17
<@McMartin>
"Day One".
06:17
<@McMartin>
It's in section 10.4.
06:18
<@McMartin>
(The Recipe Book has tones of awesome adaptable examples; the section on "Scriptable Scenes" might be worth looking through just to see the code, and then you can try to find the code in WI.
06:18
< kaura>
So def search(card): card = etc
06:18
<@McMartin>
(The language is still a WIP though so the indexing in it blows. Some informal attempts have been made, but I can't recommend any of them)
06:19
< kaura>
Oh, wait, should be search(deck, card):
06:19 * McMartin stops poking at the Spelunky source project, goes to play CiV.
06:20
< Vornicus>
right. Actually this one you're going to have to use something more creative with.
06:20
< Vornicus>
In fact, something that you haven't used before.
06:20
< Tarinaky>
McMartin: I'm already using that example to build a table. But I can't get the syntax for indexing a specific row to work.
06:20
< kaura>
Yay, new skill!
06:21
<@McMartin>
Tarianky: So, the trick with that example is that it's doing a repeat loop through it which prints a row, blanks it out, then aborts the loop with "rule succeeds"
06:21
<@McMartin>
which is kind of a return statement
06:21
<@McMartin>
repeat through skips blank lines
06:21
< Tarinaky>
Yeah, I got day one to work but it had the problem that if you stopped the tape player mid way through the play button didn't work.
06:21
<@McMartin>
So this is really "consume and dump the first entry", and since it goes every turn, it's "run through this set of statements, then stop."
06:22
< Tarinaky>
Scenes appeared to be consumed when they started. :/
06:22
<@McMartin>
You may be running afoul of recurring vs. non-recurring
06:22
< kaura>
...hrn. There'll necessarily be a for loop, I believe - need to search the deck, after all.
06:22
< Tarinaky>
Well. I got the same/similar behavior without using a scene.
06:23
< Tarinaky>
What I'm struggling with is I don't want to blank out the rows - that way I can implement FFWD/RWD or whatever.
06:23
< Vornicus>
kaura: nope, check out list's "remove" method
06:24
< kaura>
Ahh.
06:24
< kaura>
Another method to use.
06:25
< Tarinaky>
*** Run-time problem P22: Attempt to look up a non-existent row in the table Table of Ezras Spiel.
06:25
< Vornicus>
But see what happens when you put in a card that doesn't exist!
06:25
< Tarinaky>
If I attempt to access row 1 it works.
06:26
< Tarinaky>
I can't figure out how to substitute the tape player's index for a constant though.
06:26
<@McMartin>
Tarinaky: Aha, I see
06:26
<@McMartin>
Can you pastebin your code?
06:26
< kaura>
Vorn: It outputs exceptions.valueerror, right?
06:26 * McMartin is kind of Civ V'ing, but might be able to multitask some.
06:27
< Vornicus>
It throws an error.
06:27
< Tarinaky>
McMartin: Thanks for the offer but I just got it to work.
06:27
< Vornicus>
We're going to have to catch it.
06:28 cpux is now known as shade_of_cpux
06:29
< kaura>
Vorn: An "if" sequence where if there isn't such a card, the program prints "False," right?
06:29
< Tarinaky>
I'mma pastebin my working code now.
06:30
< Tarinaky>
Or would do if I could copy+paste quickly :/
06:30
< Vornicus>
actually, we're going to use try: and except:
06:31
< Vornicus>
Which are blocks themselves; they go on the same level like if and else.
06:31 * Derakon eyes Google, which thinks that opengl.org is a possible attack site.
06:31
<@Derakon>
Oh, Vorn, see anything wrong with this? http://paste.ubuntu.com/498929/
06:32
< kaura>
Dera: Does opengl run ads?
06:32
<@Derakon>
Kaura: no idea; Adblock~
06:32
< kaura>
They probably do, then, and the ad's bad. >_>
06:32
< Tarinaky>
Yeaaaaaaah. I think I just made i7 lock up :/
06:33
< Vornicus>
Der: I don't remember anything at all about OpenGL
06:34
<@Derakon>
Oh, well.
06:35
< Vornicus>
Kaura: so put your remove code in the try block, and just return None in the except block.
06:35
< Tarinaky>
McMartin: http://tarinaky.pastebin.com/QPwe0it9
06:36
< kaura>
Oh, I see. try: tells it to execute the code. except: tells it to run "this" if the code runs, but can't finish what it's looking for.
06:36
< Vornicus>
Right. the except block happens when an exception is raised within the try code.
06:38
< Vornicus>
Also: since /we/ didn't see the cards, we don't need to shuffle the deck after we've searched.
06:39
< kaura>
...huh, then an if/try combination can take a previous input, check its value, and toss them through a specified function...
06:40
< kaura>
...but that's not currently relevant.
06:42
< Vornicus>
Right. And also, in the try, return the name of the card, too. Oh, and show me the code for draw and, uh, whatever you called this one.
06:43 * Derakon whips up a test script that mirrors his OpenGL setup and main loop...and the lines draw.
06:43
<@Derakon>
So something's different about the main program that's breaking this.
06:43
< kaura>
Still working on the search function. Here's the draw function: http://pastebin.starforge.co.uk/362
06:44
< Vornicus>
kaura: why do you reuse "hand"?
06:45
< Vornicus>
Also, you can skip the assign; just put return in front of your listcomp.
06:46
< kaura>
I wasn't supposed to define what "hand" meant in draw(deck, hand)?
06:47
< Vornicus>
hand in /that/ comes from the outside.
06:47
< Vornicus>
But then you stomp on that value. Fortunately it's only inside the function, but you don't want to pull that kind of shit, really.
06:48
< kaura>
Ah, I see. Removing the assign keeps us from having problems later.
06:49
< Vornicus>
We're mangling deck on purpose; but that code also /appears/ to do violence to hand, and that's 1. not true, and 2. not intentional.
06:56
< kaura>
...hrn. Oh, think I know what I'm doing wrong. deck.remove() can't have a blank parameter, right?
06:57
< Vornicus>
Right -- you have to hand it the name of the card you want to remove.
06:58
< kaura>
Yeah, got a bit confused because of pop earlier.
06:58
< Vornicus>
Pop you don't need to because it defaults to pulling off the last thing; remove you need to tell it what you want.
07:00
<@McMartin>
Tarinaky: I'm getting a 500 there?
07:01
< Tarinaky>
A 500?
07:02
< Tarinaky>
Oh. Meh. it's unimportant anyway.
07:02
<@McMartin>
500 Internal Server Error
07:02 Derakon is now known as Derakon[AFK]
07:02
< Tarinaky>
I'm struggling to get it to let me place a second room though.
07:03
< Tarinaky>
A room called Basement is to the West of Basement Cell.
07:03
< Tarinaky>
Oh wait, derp.
07:03
< Tarinaky>
Got it!
07:03
< Tarinaky>
^^
07:05
< Vornicus>
Kaura: what have you got right now?
07:07
< kaura>
Nada. Won't even return the exception when ran. Geh. I'll pastebin what I have so far.
07:08
< kaura>
http://pastebin.starforge.co.uk/363
07:10
< Vornicus>
Okay, no, that's not how it's done.
07:10
< kaura>
Yeah, figured by now. Hm.
07:10
< Vornicus>
You don't need a for loop at all.
07:11
< Vornicus>
remove doesn't return anything; what you will return instead is the name of the card removed.
07:11
< Vornicus>
Which is to say, "return x"
07:11
< Vornicus>
And for the love of mike: return ends the function, no matter where it is. If it's in a loop? THe loop stops.
07:11
< kaura>
Oh, that's why. Right, think I have it...
07:13
< Vornicus>
And this one, honestly, you don't want it to return the exception; None is sufficient because what we're eventually going to do is wrap this in something else that knows what None means.
07:14
< kaura>
Ah, so it should just be "except: None"
07:14
< Vornicus>
(technically there's an exception-like thing in draw, too. I wonder if you can figure it out.
07:14
< Vornicus>
no, the except block is correct.
07:15
< kaura>
The exception in draw is if you draw over the number of cards available in the deck, right?
07:16
< Vornicus>
There you go.
07:16
< Tarinaky>
Nyrrrrgh. "A door called metal door is West of the Basement Cell and East of the Basement."
07:16
< kaura>
Yeah, I was actually curious as to how an overdraw would play out, so fiddled with it earlier. >_>
07:16
< kaura>
Right, still need to make it search...
07:18
< Vornicus>
remove /does/ search.
07:18
< Vornicus>
That's what it does.
07:19
< Vornicus>
It locates the first instance of that thing in the list and removes it.
07:19
< kaura>
Right. I tried "print deck.remove(x)" but everything I've inputted in IDLE tosses me the except instead.
07:20
< Vornicus>
What are you giving it for x?
07:20
<@McMartin>
Tarinaky: For the record, having rooms where one name is a subset of the other name is asking for a world of disambiguation pain.
07:20
< kaura>
'cardname'
07:20
< Vornicus>
And do you have an actual named card?
07:20
< kaura>
Yes.
07:20
< Vornicus>
Rather, do you have an actual card named "cardname"?
07:20
<@McMartin>
You might be better off making the Basement Cell just the Cell and having: The printed name of the Cell is "Basement Cell".
07:20
< kaura>
Yes, actually. Including capitalization.
07:21
< Vornicus>
hm.
07:21
< Vornicus>
Okay, show me all the code.
07:22
< kaura>
http://pastebin.starforge.co.uk/364
07:22
< Vornicus>
okay, deck.remove doesn't return anything.
07:22 Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
07:22
< Tarinaky>
McMartin: Ah. YEah. That fixed it.
07:22
< kaura>
Ahh.
07:24
<@McMartin>
(You can also use "privately-named" properties to make division of objects easier without polluting the game, but this breaks SPOT and should be avoided if you can help it)
07:24
< Vornicus>
When I say that you have to return the card name I mean it: the card name should be returned once you're done removing.
07:27
< Vornicus>
Since nothing's going to actually give you the card name other than the thing you passed in, may as well return it.
07:30
< kaura>
Right, but "return deck.remove(x)" for, example, search(deck, 'Swamp') doesn't give me anything. Hell, replacing 'Swamp' with 'Cow' doesn't even give me an exception. I'm missing something...
07:31
< Tarinaky>
McMartin: I can't seem to figure out how to make a trait (ie: lit) dependant on whether or not it is switched on.
07:31
< Tarinaky>
For example: a flashlight.
07:31
< Tarinaky>
I tried "It is a device and is lit when switched on" and also "If it is switched on: it is lit."
07:31
<@McMartin>
rules fire on actions, not properties.
07:31
<@McMartin>
So:
07:32
<@McMartin>
After switching on the flashlight: say "The flashlight burns with a bright beam!"; now the flashlight is lit.
07:32
<@McMartin>
And similarly for off.
07:32
<@McMartin>
Note that After, like Instead, short-circuits action processing and so the default Report rules will not fire on After.
07:32
<@McMartin>
So you need a custom message there.
07:32
< Vornicus>
A lamp is a kind of device. Carry out switching on a lamp: now the noun is lit. Carry out switching off a lamp: now the noun is unlit. /// The lantern is a lamp. The lantern is carried. The description is "This lantern is not nearly as shineh as everything else around here, but it can be very bright.". Instead of burning the lantern, try switching on the lantern. Understand "lamp" as the lantern.
07:33
< Vornicus>
(the "instead of burning..." line is so that "light lantern" works.)
07:35
< kaura>
Hrn... hunger pangs be distractin' me from code-wrassling. More spaghetti.
07:36
< jerith>
Just don't get the spaghetti in the code... ;-)
07:37
< kaura>
pfft
07:37
< Vornicus>
(quite.)
07:38 * jerith goes to make some breakfast.
07:38
< Vornicus>
Yay Breakfast
07:42
< jerith>
So much for breakfast. My bread is no longer edible.
07:42
< kaura>
Stale or mold?
07:42
< jerith>
The latter.
07:42 * McMartin prepares for what looks like the end-run for Unwound Future.
07:42
< kaura>
...yep, only good for growing plants now.
07:42
< jerith>
Stale isn't much of a problem, because I was going to toast it anyway.
07:43
< jerith>
Cheese mould can just be cut off. Bread mould has already infiltrated the whole loaf by the time it becomes visible.
07:46 Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has quit [Connection reset by peer]
07:46 Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has joined #code
07:48 Rhamphoryncus [rhamph@Nightstar-473f8685.abhsia.telus.net] has quit [Client exited]
07:53 kwsn [kwsn@Nightstar-a0abd809.dyn.centurytel.net] has joined #code
08:03 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
08:07 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
08:15 * kaura headbutts some more at the list.remove() problem. What am I not understanding...
08:17
< Vornicus>
Show Me What You Have.
08:17 * jerith wanders further afield for breakfast.
08:18
< kaura>
I haven't made any changes from last time, actually. I'm just staring at it and wondering where the incomprehension is.
08:18
< Alek>
...
08:18
< Vornicus>
Okay. you're passing in the deck, right, and you have (by the time this code runs) loaded the deck, right?
08:19
< kaura>
Right.
08:19
< Vornicus>
Okay, so.
08:19
< Vornicus>
printing the result of remove won't do anything: there's nothing in there.
08:20
< Vornicus>
it returns nothing -- which is to say, None.
08:20 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
08:20
< Tarinaky>
"The index of the noun is then 1." is a phrase it doesn't recognise :/
08:20
<@McMartin>
"Now the index of the noun is 1."
08:20
< kaura>
...oh, I see. remove simply takes it out. So... where do I put it and how...
08:20
<@McMartin>
Those bits are still a programming language like any other, just a little more verbose.
08:20
< kaura>
...wait, is it..
08:21
<@McMartin>
The win comes when you can chain adjectives together for insanely complex conditions.
08:21 Syloqs_AFH is now known as Syloqs-AFH
08:21
< Tarinaky>
McMartin: Ahh. I'd never have guessed that.
08:21
< jerith>
The verbosity (and the nounosity, etc.) feels quite natural in the context, though.
08:21
<@McMartin>
Chapter 8: "Change", covers the variables part of standard programming
08:22
<@McMartin>
And Chapter... 11? "Phrases" does the defining-functions and if/then/while/etc. parts.
08:22
< kaura>
Like this? http://pastebin.starforge.co.uk/365
08:22
< Tarinaky>
Cheers.
08:22
< Vornicus>
kaura: bingo.
08:22 * jerith should work on Battle Stations some more.
08:22
<@McMartin>
Tables are roughly equivalent to static arrays, and the newer versions of I7 also have dynamic linked lists.
08:22
<@McMartin>
(Under "Lists")
08:22
< kaura>
Ah, excellent. Wow, that took a lot of headbutting on my part. >_O
08:22
< jerith>
There aren't any Wodehouseian aunts in it yet.
08:22
< kaura>
Only, one problem.
08:22
<@McMartin>
Relations are slowly generalizing into a form of multimap that's fully integrated into the parser and are kind of terrifying
08:22
< kaura>
I tested it under the condition search(deck, 'Cow'), and it generated a blank, not "None."
08:23
< Tarinaky>
McMartin: As I understand it though, my use of the word visible means that my tape player won't work in the dark. How would I go about implementing an 'audible'?
08:23
< jerith>
None is printed as an empty tring.
08:23
< jerith>
*string
08:23
< Vornicus>
kaura: None is blank.
08:24
<@McMartin>
Tarinaky: Maybe "If the location of the player is the location of the tape player"?
08:24
< jerith>
Try printing repr(thingy). :-)
08:24
< kaura>
Oh, good.
08:24
<@McMartin>
That'll work though it's also still audible through, say, a closed box.
08:24
<@McMartin>
What you're describing here is the "sense-passing problem", most generally, which is pretty complex if you let it get out of hand.
08:25
< Tarinaky>
"it looks as if you intend 'the player is the location of the tape player' to be a condition, but that would mean comparing two kinds of value which cannot mix - a person and a room - so this must be incorrect."
08:25 * Tarinaky looks up sense-passing problem.
08:25
< Vornicus>
All right. Now, I have three other operations you might want, all of which I think are important to a Magic thing, but I want to see if you can guess them.
08:26
< Tarinaky>
McMartin: What is a 'sense passing problem'? Google is unhelpful.
08:26
< Tarinaky>
Oh derp. Missed out an in.
08:26 * Tarinaky is finding it -really freaking hard- to spot simple errors in ENGLISH >.<
08:27
< jerith>
Tarinaky: That's because you're used to ambiguity in the language.
08:27
<@McMartin>
It's the name the other major text-game system uses for it, which goes to absurd lengths to handle it.
08:27
<@McMartin>
The sense-passing problem is "which stimula can still be perceived through which barriers?"
08:27
< kaura>
Vorn: Discard, put on top of library, put into a graveyard list... and, actually, Mulligan.
08:27
< kaura>
Wait, the first and third are the same. Whups.
08:27
< Alek>
remove from game.
08:28
< kaura>
Oh, right, remove from game.
08:28
< Alek>
phase
08:28
< kaura>
No, no phasing. Fuck phasing.
08:28
< Tarinaky>
McMartin: I suppose no more complicated than modling liquid physics - which I've seen examples for.
08:28
< kaura>
>_>
08:28
< Tarinaky>
*modelling
08:28
< kaura>
Well, RFG might not be necessary. Right now, this is manipulating what's in the hand, not on the field.
08:28
<@McMartin>
Liquid is nastier, actually
08:28
< Vornicus>
kaura: Actually this thing only cares about the library. Nothing else.
08:29
< Alek>
liquid physics is just solid physics for a large enough quantity of solids. :P
08:29
< Vornicus>
It doesn't even, right now, keep track of your hand!
08:29
<@McMartin>
Because you can split Some Water into Some Water and Some Water, and that's before you start getting into mixtures.
08:29
< kaura>
...shuffle on command?
08:29
< Tarinaky>
Depends how much of the problem you model.
08:29
< Vornicus>
"put on top of library" is one of them; "shuffle" is another -- but it's usually connected to "examine library", so those two will go together.
08:30
< Vornicus>
Unless you can name a card where you shuffle your library without looking at it!
08:30
< kaura>
Yes, actually. There was an artifact creature in the original Mirrodin block.
08:30
< jerith>
Make them separate and call one from the other.
08:30
< Vornicus>
There's one -- no, two more actually -- that I can think of.
08:31
< jerith>
Give that there are "put card on {top,bottom} of library" actions, shuffling without looking isn't a noop.
08:31
< Vornicus>
One I know happens; the other I'm not sure about.
08:31
< kaura>
Oh, right, also one of the latest cards. It goes from your graveyard into your library, then you shuffle. Looking at the library isn't necessary.
08:31
< Vornicus>
and jerith finds one of my two; kaura just came up with one I hadn't thought of.
08:32
< Tarinaky>
McMartin: How do I specify an alias for an object? I can't see a relevant heading in the manual.
08:32
<@McMartin>
What do you mean here by "Alias"?
08:32
<@McMartin>
Like, a variable that points at an object?
08:32
< Tarinaky>
A torch is another word for flashlight.
08:32
< jerith>
Tarinaky: Understand "lamp" as the lantern.
08:32
< Vornicus>
"understand torch as the flashlight"
08:32
<@McMartin>
In the code, you can't. In the *game*, that's Understanding.
08:32
<@McMartin>
Understand "torch" as the flashlight.
08:32
<@McMartin>
It's more complex than that though
08:33
<@McMartin>
The chapter on Understanding goes into full details.
08:33
<@McMartin>
The chapter on Things may be a better place to start.
08:33
< kaura>
Well, a shuffle command should be easy...
08:33
< Tarinaky>
Problem. You wrote 'Understand torch as the flashlight' : but 'understand' should be followed by a textual description, as in 'understand "take [something]" as taking the noun'.
08:33
<@McMartin>
You need quotes around "Torch"
08:33
< jerith>
Tarinaky: The quotes are important.
08:33
<@McMartin>
This will also only work in-game.
08:33
< Vornicus>
You can call it "shuffle", as random.shuffle will not collide with it.
08:33
< Tarinaky>
Oh!
08:34
< Tarinaky>
What do you mean by in-game?
08:34
< jerith>
The player can use "torch" to mean "flashlight", but the programmer cannot.
08:34
<@McMartin>
The player can type TORCH and mean the flashlight, but you can't say torch in your source code and mean the flashlight, anymore than you could say "allow x to mean y" in a programming language.
08:35
<@McMartin>
What you *can* do in the code is have x be a reference to y; that's "x is a (kind of thing that y includes) that varies. x is y."
08:35
<@McMartin>
And then later on you could make x refer to z with "now x is z".
08:35
<@McMartin>
"The player" is in fact a person that varies, defaulting to an object named "yourself".
08:35
< kaura>
Vorn: Right. Kinda figured. "Shuffle" only interacts as an appended method to random, so on its own it's not yet defined.
08:35
< jerith>
Which means you can switch protagonists. Which is pretty cool.
08:36
< Tarinaky>
Oh I see.
08:36
< Vornicus>
But yeah: add a card to the top, add a card to the bottom, shuffle, examine the deck. There's one more that I know there's a card that does it but I don't know...
08:36
< Vornicus>
if you remember it.
08:37
<@McMartin>
I believe but am not positive that to properly change the player you have to do more than just say "Now the Player is Bob", but that may have been improved since I last checked.
08:37 * McMartin eyes Professor Layton and the Unwound Future.
08:37
< jerith>
I've never actually used it.
08:37
< kaura>
Ah, that was easy. "def shuffle(): random.shuffle(deck); return deck"
08:37 * jerith actually goes to get some food now.
08:37
< Vornicus>
Pass deck in!
08:38
< jerith>
Cheery-bye ladies and gents.
08:38
< kaura>
Ah, right.
08:38
<@McMartin>
jerith: Nor have I, even when I had multiple PCs.
08:38
<@McMartin>
(Which my first full-length game did)
08:39
< Vornicus>
and technically you don't need to return deck; it already is available in its mangled form once you call random.shuffle
08:39
< kaura>
Right, that was more for testing.
08:41
< kaura>
Now, lesse... to put a card on top of the library. Let's call this deck_top()...
08:42
< Vornicus>
Remember: pop removes stuff from the end; there is a function I've mentioned that puts stuff onto the end.
08:42 * Vornicus checks. At least three cards in Magic do the thing for the last method he's got in his list.
08:42
< kaura>
Append, right?
08:43
< Vornicus>
append.
08:44
< kaura>
I'm guessing there's an alternative to append that puts it at the beginning instead?
08:44
< Vornicus>
Adding to the bottom is harder; look at the "insert" method on lists.
08:45
< kaura>
Ah, line.insert(a, b) where b is the index value?
08:45
< Vornicus>
Something like that, yeah, I haven't used it in a long time.
08:45
< Vornicus>
...four...
08:46
< Vornicus>
and the index value of the start of the list is...?
08:46
< kaura>
0
08:47
< Vornicus>
Ok, so, show me what add to bottom looks like.
08:48
< kaura>
Wait, add to bottom? Sorry, I thought this was the add-to-top function? Wouldn't add to bottom be deck.append?
08:49
< Vornicus>
Add to /top/ is deck.append; draw uses pop, which works at the end, and pulls from the top.
08:49
< kaura>
...oh, right. Got the ends confused. >_O
08:52
< Vornicus>
The others are also pretty easy; examining the deck though you're going to want to do something to it to make life easier for the user.
08:52
< Vornicus>
see, it's a heck of a lot easier to find what you're looking for... when they're in alphabetical order.
08:52
< kaura>
...hrn. So it's actually "a" that was the index value, making it deck.insert(0, x).
08:53
< Vornicus>
sounds about right.
08:53
< kaura>
But... how do you then return the resultant hand...
08:53
< Vornicus>
you don't. Don't worry about it for now.
08:53
< kaura>
Ah, alright.
08:54
< Vornicus>
This program is only caring about the library.
08:54
< Vornicus>
Handling the hand and battlefield would be another several hundred lines.
08:54
< kaura>
Hah.
08:54
< Vornicus>
And that doesn't even /consider/ the actual effects of cards.
08:54
< kaura>
Oh, gods. If Magic Online's anything to go by, you need an entire, dedicated staff to manage that.
08:55
< kaura>
And even then, some cards are so blatantly rulebreaking that they end up having to ban, mostly temporary, some cards to prevent foul-ups.
08:56 * Vornicus gives kaura an already-used Chaos Confetti. On his head.
08:56 jeroid [jerith@687AAB.5E3E50.DC5717.19583B] has joined #code
08:56
< kaura>
Nnnoooooo-*
08:57
< kaura>
Right, now for deck_bottom.
08:57
< Vornicus>
The hardest in this group is examine.
08:58
< Vornicus>
Mostly because it uses a function I haven't talked about yet.
08:58
< kaura>
Yay, new function
08:58
< Vornicus>
Also there's still The Mystery Operation, which is actually easy.
08:59
< kaura>
...man, maybe deck_bottom isn't necessary. deck.append('card') does the same thing without having to redefine it. Well, can change it to bottom() instead to save keystrokes.
09:00
< Vornicus>
Um.
09:00
< Vornicus>
Okay, two things.
09:00
< kaura>
...
09:00
< Vornicus>
append is, again, top.
09:00 * kaura headdesks
09:00
< kaura>
Still confused, it looks.
09:00
< Vornicus>
And the reason I want functions for this is so that we can do something really scary next time.
09:00
< kaura>
Right, placement fixed.
09:02
< kaura>
Alright. The examine function. So, if I'm anticipating this right, it draws the whole deck separately, then shuffles when dismissed?
09:02
< Vornicus>
...well, sort of.
09:03
< Vornicus>
the function that we want to use is called "sorted"
09:03
< kaura>
Oh, right, and sort in alphabetical order.
09:03
< Vornicus>
it returns a copy of the list it's given, in order.
09:03
< Vornicus>
we'll also want to shuffle the deck; this can technically happen before we use sorted (but not in the same line!)
09:05
< kaura>
...hm. If we're seeing the deck after deck.sort(), does it need to be shuffled? If you only see the sorted list, then the only relevant time to shuffle would be if the deck had been further manipulated, right?
09:05
< Vornicus>
no, don't use deck.sort()
09:05
< Vornicus>
use sorted(deck)
09:06
< kaura>
Ah.
09:06
< Vornicus>
deck.sort() and sorted(deck) do two different things; since we want this to be atomic, we want to return a sorted copy of the deck, and shuffle the original deck. We can't go back after we finish examining.
09:07
< kaura>
Oh, right. Returning sorted(deck) just gives you a list of the deck contents. deck.sorted directly sorts the deck itself.
09:07
< kaura>
er, deck.sort()
09:07
< Vornicus>
right.
09:08 You're now known as TheWatcher
09:08
< Vornicus>
So when you think you've got that figured out, show me.
09:08
< kaura>
Sorted defaults to alphabetical order, right?
09:09
< Vornicus>
Right. If you want to change it there's stuff you can do but I'm not showing it to you yet.
09:09
< kaura>
Right.
09:10
< Vornicus>
Anyway when you th... dammit, said that.
09:10
< kaura>
http://pastebin.starforge.co.uk/366
09:11
< Vornicus>
What happens when you return something?
09:11
< kaura>
Alphabetically sorted list.
09:11
< kaura>
Ah, wait, not the right answer.
09:13
< kaura>
It... prints out the result of the first action taken. I think.
09:14
< kaura>
And stops the operation at that point - oh, the shuffle command ought to go before.
09:14
< Vornicus>
There you go.
09:14
< kaura>
There, fixed.
09:15
< Vornicus>
All right, so at this point I want to see the entire script.
09:16
< kaura>
http://pastebin.starforge.co.uk/367
09:18
< Vornicus>
Very nice.
09:18
< Vornicus>
Now, there is one last operation I am aware of.
09:19
< Vornicus>
It's used on at least 8 cards. Strangely enough, one of the cards shares its name with a set.
09:21
< kaura>
...it better not be something like Shahrazad...
09:21
< Vornicus>
Nothing so ridiculous. Several of the cards are type-2 legal.
09:22
< kaura>
Oh, Cascade?
09:23 * Vornicus checks. That wasn't on his list.
09:23
< kaura>
That digs through the library too.
09:23
< Vornicus>
Nope.
09:23
< Vornicus>
For one thing that requires a database of cards, and we don't have that.
09:23
< kaura>
It'd be difficult to implement without first appending converted mana costs to the cards, at the very least.
09:23
< Vornicus>
This one, strangely enough, does not change the library.
09:24
< kaura>
Look at the top card of your library?
09:25
< Vornicus>
There you go. "Future Sight"
09:25
< Vornicus>
Usually computer nerds call this power "peek"
09:26
< Vornicus>
All you have to do, then, is return the thing at the appropriate index.
09:27
< kaura>
Hrm. I'll refrain from doing so for this exercise, but it wouldn't be all that hard to convert it into a peek(x) function, so you can look at multiple cards, huh, using the range function...
09:28
< Vornicus>
Indeed.
09:29
< kaura>
Right, that works well enough. peek(deck): return deck[0]
09:29
< Vornicus>
No it doesn't.
09:29
< kaura>
09:29
< Vornicus>
That's the bottom card.
09:29 * kaura facepalms
09:30
< kaura>
...hm. Alright, that's trickier then. If you want to be able to peek when the deck's been altered...
09:30
< Vornicus>
We just want to be able to peek at will.
09:30
< Vornicus>
A more complete system would actually hook into these to peek whenever the deck changes, but that has a tinge of event modeling, and that's a bit much.
09:31
< EvilDarkLord>
Vorn, do you TA or similar? You seem to have a habit of teaching people to code.
09:32 [1]kaura [kaura@Nightstar-fd82400d.snfc21.sbcglobal.net] has joined #code
09:32 kaura [kaura@Nightstar-fd82400d.snfc21.sbcglobal.net] has quit [Client closed the connection]
09:32 [1]kaura is now known as kaura
09:33
< Vornicus>
I do.
09:33
< Vornicus>
WHat'd you last get, kaura?
09:33
< kaura>
"We just want to be able to peek at will."
09:33
< Vornicus>
A more complete system would actually hook into these to peek whenever the deck changes, but that has a tinge of event modeling, and that's a bit much.
09:34
< Vornicus>
Anyway, there is a specific index number that will always point at the last thing in a list.
09:34
< kaura>
...hm.
09:35
< Vornicus>
http://docs.python.org/library/stdtypes.html#sequence-types-str-unicode-list-tup le-buffer-xrange Note 3 should give you a hint.
09:36
< Vornicus>
http://docs.python.org/library/stdtypes.html#mutable-sequence-types <--- also note 6 here; that's the documentation for pop()
09:37
< kaura>
Ah, a negative integer.
09:37
< Vornicus>
which one, specifically?
09:39
< kaura>
-1, if I'm reading the info on pop() correctly
09:39
< Vornicus>
Indeed.
09:39
< Vornicus>
So what's peek look like?
09:39
< kaura>
peek(deck): return deck[-1]
09:39
< Vornicus>
perfect.
09:40
< Vornicus>
All right, that's all the functions we need tonight. Tomorrow, we'll set it up so we can call these functions as a user instead of just as a programmer.
09:40
< kaura>
Excellent! Thank you.
09:41
< Vornicus>
also.
09:41
< Vornicus>
"Aesthetic Consultation" is a really fucked up card.
09:41 Anno[Laptop] [annodomini@Nightstar-7d67b83e.adsl.tpnet.pl] has joined #code
09:41
< kaura>
Hahaha, yes.
09:44 jeroid [jerith@687AAB.5E3E50.DC5717.19583B] has quit [[NS] Quit: Bye]
09:46 Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has quit [Client closed the connection]
09:56
< Vornicus>
ok bedtime.
09:56
< kaura>
G'night
09:57 Vornicus is now known as Vornicus-Latens
10:00 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
10:03 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
10:04 Syloqs_AFH is now known as Syloqs-AFH
10:17 kaura [kaura@Nightstar-fd82400d.snfc21.sbcglobal.net] has quit [Client closed the connection]
10:17 [1]kaura [kaura@Nightstar-fd82400d.snfc21.sbcglobal.net] has joined #code
10:18 [1]kaura is now known as kaura
10:42 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
10:43 Ortiha [orthianz@Nightstar-d6ed1097.xnet.co.nz] has quit [Ping timeout: 121 seconds]
11:48 Orthia [orthianz@Nightstar-02db8a08.xnet.co.nz] has joined #code
12:59 SmithKurosaki [Smith@Nightstar-e73eb6b0.dsl.teksavvy.com] has quit [Ping timeout: 121 seconds]
13:30 celticminstrel [celticminst@Nightstar-f8b608eb.cable.rogers.com] has joined #code
13:31 kaura [kaura@Nightstar-fd82400d.snfc21.sbcglobal.net] has quit [[NS] Quit: Dreaming of a blizzard of cardboard.]
14:11 TarinakyKai [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code
14:12 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Operation timed out]
14:18 TarinakyKai [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Connection closed]
14:22 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
14:28 Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
15:02 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!]
15:38 Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
17:11 celticminstrel [celticminst@Nightstar-f8b608eb.cable.rogers.com] has joined #code
17:14 kwsn is now known as kw-school-n
17:24 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code
17:33 Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code
17:40 aoanla [AndChat@37647E.0002A6.410380.1C45B3] has joined #code
17:42 aoanla [AndChat@37647E.0002A6.410380.1C45B3] has quit [[NS] Quit: ]
17:43 Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [Client closed the connection]
17:44 Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code
18:07 Rhamphoryncus [rhamph@Nightstar-473f8685.abhsia.telus.net] has joined #code
18:16
< Tarinaky>
A light is a kind of device. After switching on a light: say "You switch the light on."; Now it is lit. After switching off a light: say "You switch the light off."; Now it is unlit.
18:17
< Tarinaky>
Problem. In the sentence 'Now it is lit' , I was expecting to read a condition, but instead found some text that I couldn't understand - 'it is lit'.
18:19
< Tarinaky>
Ahah!
18:23
< simon_>
I wonder, does anyone know of a wall clock design with inequal distances between the hours? such that the arm mechanically moves at different speeds.
18:24
< Anno[Laptop]>
I've never seen anything like that.
18:25
< simon_>
someone pointed at a wall clock with an elliptic distribution
18:25
< simon_>
I was thinking of something like a logarithmic distribution
18:26
< simon_>
brb
18:26
< Tarinaky>
It's probably possibly, but very difficult.
18:26
< simon_>
well, maybe not!
18:26
< simon_>
maybe if you do it mechanically, which would be the most interesting
18:26
< Tarinaky>
I'm thinking mechanically.
18:27
< simon_>
it reminds me of that analog gear shift
18:27
< simon_>
I can't find it! it was so cool.
18:28
< Tarinaky>
You'd have to change the gear.
18:28
< simon_>
basically it allows you to shift gears continuously rather than in discreet intervals.
18:28
< Tarinaky>
But you can't do that in a continuous way.
18:28
< simon_>
yes you can
18:28
< Tarinaky>
Sure;y you'd need an infinite number of gears?
18:28
< simon_>
no, I'd need an analog gear.
18:28
< simon_>
I'm digging incessantly for the youtube video.
18:28
< simon_>
http://en.wikipedia.org/wiki/Continuously_variable_transmission
18:29
< simon_>
http://www.youtube.com/watch?v=kVPjhmTThPo -- bit commercial. there's cooler films out there.
18:31
< simon_>
but yeah, that'd be beyond a home project, at least for me. :)
18:33
< simon_>
actually, that video doesn't show how the gear shift works on the inside.
18:35
< simon_>
but control the hands by a stepper motor...
18:42
< simon_>
then I'd just need to figure out how to keep track of time precisely enough from something like an Arduino.
18:42 Anno[Laptop] is now known as AnnoDomini
18:49
< Tarinaky>
I can't seem to get if-then-else to work in inform7 (Or rather, if-then-otherwise)
18:51
<@ToxicFrog>
You don't have enough squirrels in your computer.
18:51
<@ToxicFrog>
Add more squirrels and try again.
18:52
< Tarinaky>
http://tarinaky.pastebin.com/EfbbybAW << is giving me the compile time error: You wrote 'otherwise' : but the punctuation here ':' makes me think this should be a definition of a phrase and it doesn't begin as it should, with either 'To' (e.g. 'To flood the riverplain:'), 'Definition:', a name for a rule (e.g. 'This is the devilishly cunning rule:'), 'At' plus a time (e.g. 'At 11:12 PM:' or 'At the time when the clock chimes') or the name of
18:52
< Tarinaky>
a rulebook, possibly followed by some description of the action or value to apply to (e.g. 'Instead of taking something:' or 'Every turn:').
18:55
<@ToxicFrog>
if foo, do x; otherwise, do y.
18:55
<@ToxicFrog>
As the error message says, ':' is the wrong punctuation.
18:57
< Tarinaky>
Problem. In the sentence 'if the Energy of it is 0, switch it off' , I was expecting to read a condition, but instead found some text that I couldn't understand - 'Energy of it is 0'.
18:59
<@ToxicFrog>
'if the Energy of the noun is 0', perhaps? Sorry, I'm a bit shaky on that corner of the grammar.
18:59
<@ToxicFrog>
...hrm. This example implies that 'otherwise:' should work also.
19:00
< Tarinaky>
It's still not matching the condition for some reason.
19:00
< Tarinaky>
Whether I say it or the noun.
19:01
<@ToxicFrog>
"not matching the condition" as you get the same compile time error?
19:01
< Tarinaky>
Yes.
19:01
< Tarinaky>
I get a similar one for the "otherwise, decrement the energy of it" but I'm concentrating on the if first >.>
19:01
< Tarinaky>
*on the then first
19:02
<@ToxicFrog>
...isn't I7 case sensitive?
19:02
< Tarinaky>
I've seen nothing to support that.
19:03 * AnnoDomini assumes things are case-sensitive until proven otherwise.
19:03
< Tarinaky>
I don't think I'm mixing case anyway.
19:03
<@ToxicFrog>
Energy and energy?
19:04
< Tarinaky>
I don't see a lower case energy.
19:04
< Tarinaky>
Except in the compiler's error message.
19:04
< Tarinaky>
Changing the source to 'energy' has no effect.
19:05
<@ToxicFrog>
<Tarinaky> I get a similar one for the "otherwise, decrement the energy of it"
19:05
< Tarinaky>
ToxicFrog: I typed that out, I didn't copy+paste it.
19:05
<@ToxicFrog>
At any rate, no, I don't think this is the actual problem, but even if the language is case insensitive you should be consistent.
19:05
<@ToxicFrog>
Aah.
19:05
<@ToxicFrog>
Anyways. Can you perhaps pastebin the code somewhere?
19:05
< Tarinaky>
I thought I did.
19:05
<@ToxicFrog>
Oh, so you did
19:05
<@ToxicFrog>
Sorry, missed it
19:07
<@ToxicFrog>
Stand by.
19:07
< Tarinaky>
http://tarinaky.pastebin.com/YGuTZ7R2 << is how it stands presently.
19:26
<@ToxicFrog>
Hmm.
19:26
<@ToxicFrog>
The "Witnessed 1" example (in the chapter on Time) may be useful.
19:32
< Tarinaky>
Witnessed 1 is a lot more complicated than what I'm trying to do and I'm not sure exactly what is pertinant and what isn't :/
19:59 * ToxicFrog stabs the I7 IDE
20:03
<@ToxicFrog>
For some reason it takes it ~30s at 100% CPU usage to copy text.
20:03
<@ToxicFrog>
Tarinaky: http://lua.pastey.net/140908
20:03
<@ToxicFrog>
That may be more helpful.
20:03
<@ToxicFrog>
That said, I suggest reading through all of WWI sooner rather than later.
20:05 * Tarinaky nods. I'll have another go at it in a bit.
20:42 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
21:08 Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [Ping timeout: 121 seconds]
21:27
< Tarinaky>
Gwuh. I've lost the WW1 page :/
21:27
< Tarinaky>
Nm! Found it!"
21:50 Stalker [Z@2C3C9C.B2A300.F245DE.859909] has joined #code
22:06
<@ToxicFrog>
Tarinaky: er, it's built in to the Inform IDE
22:06
<@ToxicFrog>
Along with TRB
22:06
<@ToxicFrog>
Failing that, inform7.com -> Learn
22:06 kaura [kaura@Nightstar-fd82400d.snfc21.sbcglobal.net] has joined #code
22:06
< Tarinaky>
ToxicFrog: I know, but I couldn't remember what page the Witnessed example was linked on.
22:07
<@ToxicFrog>
Aah.
22:07
<@ToxicFrog>
Alphabetical index of examples :P
22:09
< Tarinaky>
I have a modified version of Witnesses 1 working.
22:10
< Tarinaky>
Currently trying to figure out how I can make the battery compartment implicitly open when you try to put batteries in it.
22:34
< Tarinaky>
It's a little annoying that there's no MI.
22:35
< Tarinaky>
(I can't say something is a torch -and- battery operated)
22:37
<@McMartin>
Tarinaky: You can get around this by defining your own adjectives.
22:39
< Tarinaky>
Also - don't suppose there's any way of adding source control to i7?
22:40
< Tarinaky>
I mean, short of manually and hackishly.
22:43
<@McMartin>
Define "manually"?
22:43
<@McMartin>
I mean, I just type "git commit -a" from the directory containing MyStuff.inform and MyStuff Materials
22:44
< Tarinaky>
cd foo.inform/; git init; git commit -am"First commit"
22:44
< Tarinaky>
Yeah.
22:44
<@McMartin>
I guess my next question is "That's what I do for *all* my projects. What are you expecting?"
22:45
<@McMartin>
(That said, don't do it in the .inform level; do it one level up because a full-scale project has two directories.)
22:45
< Tarinaky>
I thought the other one was for releases?
22:45
<@McMartin>
It's also where you keep the materials that get bundled up with it, like cover art or manuals or whatnot
22:46
<@McMartin>
(I personally also throw the extensions I use in there for archival purposes)
22:47
<@McMartin>
There *are* a couple of places where checkouts get wonky, but I forget if git does it right. SVN didn't.
22:47
< Tarinaky>
git doesn't do checkouts.
22:48
<@McMartin>
it does, but it means revert~ "where cloning gets wonky".
22:48
<@McMartin>
As in, Inform expects certain directories to exist but be empty.
22:48
<@McMartin>
(And you only need to actually put two files under control, too; the rest can be ditched)
22:49
<@McMartin>
(the uuid file and Source/story.ni are the important ones.)
22:49
< Tarinaky>
What's the uuid for?
22:50
<@McMartin>
It's embedded in the produced binary so that the global index sites can uniquely identify a work instead of just the binary.
22:59
< Tarinaky>
I see.
23:06
<@McMartin>
(if you type VERSION at the prompt you'll see an "IFID" listed. Those should be unique *per work* so later versions of the game should use the same ID, etc.)
23:07
<@McMartin>
There seems to be some dispute about whether remasterings should do this.
23:08
<@McMartin>
Weishaupt Scholars effectively did this - the IntroComp edition has a different IFID than the full game - but the IntroComp edition predates the Treaty of Babel that set the IFID standard.
23:11
<@McMartin>
The Mac interpreter Zoom and my own metadata browser Blorple both read the UUID to collate versions of a program.
23:11
<@McMartin>
Blorple still currently prioritizes filenames though because it's mostly for indexing pre-existing unorganized collections and then I lost interest/decided it needed to be rewritten from scratch again.
23:16
< Tarinaky>
How do you control the default setting for lit/dark for rooms?
23:28 You're now known as TheWatcher[T-2]
23:30 You're now known as TheWatcher[zZzZ]
23:32 Stalker [Z@2C3C9C.B2A300.F245DE.859909] has quit [Ping timeout: 121 seconds]
23:33 Stalker [Z@2C3C9C.B2A300.F245DE.859909] has joined #code
23:35 kw-school-n [kwsn@Nightstar-a0abd809.dyn.centurytel.net] has quit [Ping timeout: 121 seconds]
23:36
<@McMartin>
"A room is usually dark."
23:36
<@McMartin>
Rooms start out usually lit.
23:42 kw-school-n [kwsn@Nightstar-a0abd809.dyn.centurytel.net] has joined #code
23:48
< Tarinaky>
Ahhh.
23:48
< Tarinaky>
Heh.
23:57 shade_of_cpux is now known as cpux
--- Log closed Sat Sep 25 00:00:52 2010
code logs -> 2010 -> Fri, 24 Sep 2010< code.20100923.log - code.20100925.log >