Log in

No account? Create an account
25 August 2005 @ 09:39 am
Didn't really do much on Tuesday (well, made icons for 100contest, got carried away with it, and still aren't quite sure if the two I've entered are my favourites out of the 9 I made - some of which, btw, really suck), and yesterday it poured with rain all day, so my plan of sitting outside and reading my book didn't really get off the ground ;) I did go out briefly and check when the barbers up the road was open for J ... it was quite nice walking around, for a short while, in the rain :)

Ooh, also yesterday, I got a Gold Star for Observation :) So I made myself one. Why, yes, I am silly. gold star

I read the bit in the Learning Perl book on sorting, which was easier than I expected. So first I made my script sort the list on kills/game ... then I thought about it a bit more and decided that it would be best done on the ratio between kills/game and deaths/game. So I got that working, got a new copy of the logs as from yesterday, and discovered that people with spaces in their names broke my script. Pah! Pah, I say! J gave me the way out of that problem - I'd forgotten that if you put bits of a regexp in () then you can refer to those bits later as $1 etc. So instead of splitting the line into bits at the spaces and putting it in an array then picking particular ones of them I could use a regexp to match the line: /^\s*\d+:\d+ Kill: [\d|\s]+: (.+) killed (.+) by (.+)/ Then $1 is the killer, $2 is the dead person and $3 is the weapon (which I'm not using yet). It took me a while, and J's help, to notice that there was not always 1 space at the beginning of the line, and that's why the numbers were screwy. But it works now :) I need to re-write the other bits to use regexps too, I think, and then turn that whole section into a collection of if/elsif/else statements, rather than the somewhat fucked up if/next collection I have. No I don't know why I did that either.

I also made it take a file with a list of botnames as an argument and take those out, coz who cares ;) And the names don't always come attached to the same difficulty level, so it's hard to generalise over the games, anyway. It's probably possible to get that out of the file and put the stats in as something like <name>(<level>), which might be interesting, but I'm still tending towards who cares ;)

I need to read about data structures next, before doing too much more to this script though - I may need to gut it and re-write, best to do that before getting much more carried away. Though I might make it output 3 tables rather than one, each sorted on a different stat - kills/game, deaths/game and kill ratio. Current output: Team Arena stats; Western Quake stats.

Does it say something bad and wrong about me that I can't type 'ratio' right first time? It always starts life as 'ration' and then gets corrected.

I've just this second realised that if anyone's name is part of someone else's name then they'll not get distinguished properly. That needs fixing.

iconstillness closed voting last night, winners here. I totally missed the zodiac theme of the source images, but I think a fair few people did too. My entries were:

circle inset icon only the game icon
Current Mood: cheerfulcheerful
Current Music: Rage Against the Machine "Rage Against the Machine"
jaqjaq on August 25th, 2005 09:25 am (UTC)
Oops, I notice a 'Jaq' and a 'jaq' in the WQ stats. How awkward ;-)
Margaretpling on August 25th, 2005 09:29 am (UTC)
Yeah, I dithered for a while about whether to ignore case, and if so which case to use as display ... but then decided that though I know that Jaq and jaq are you, that's not really a generic assumption I can make. Although there's no way to ensure that people don't swap names with each other, anyway.

It amuses me that one of you is better than the other of you ;)
jaqjaq on August 25th, 2005 01:42 pm (UTC)
I think one of me is on this PC and the other one on the other one. Not sure if that explains the difference in results though.
Johnjarel on August 25th, 2005 09:32 am (UTC)
Gold star for observation? Is there some context to go with that? Perhaps I'm just being unobservant :)

I wonder if, rather than leaving the bots out, it might be interesting to separate the stats out into tables of humans and bots - it might give some context. But you're probably right overall to just leave them out.
Margaretpling on August 25th, 2005 09:38 am (UTC)
The context is rather boring, to be honest. A newbie logged onto sp last night and his username and domain name were different mis-spellings of the same word. I noticed, but Narenek didn't, so he gave me a Gold Star for Observation :) See, boring ;)

I was thinking that if I had the bots in and differentiated by level then their entries could look something like Bot:Megan(5) ... which would then give boundaries for how people matched up to the bots on those stats, if you see what I mean? I'm assuming that all level 5 bots will cluster, despite the random chance element in the stats.
magidmagid on August 25th, 2005 10:58 am (UTC)
My ratios frequently start as rations, too.
Margaret: Eek! So scary!pling on August 25th, 2005 11:07 am (UTC)

Well, at least I'm not uniquely bad & wrong ;)
Ruheruhe on August 25th, 2005 01:31 pm (UTC)
May I have a gold star too, please? Just because?
Margaretpling on August 25th, 2005 01:38 pm (UTC)

Sure. Here you go:

gold star
Ruheruhe on August 25th, 2005 02:01 pm (UTC)
Thanks. :)
Randal L. Schwartzlivemerlyn on August 27th, 2005 04:21 pm (UTC)
which edition of Learning Perl?
And thanks for saying it was easier than expected. :)
Margaretpling on August 28th, 2005 08:04 am (UTC)
Re: which edition of Learning Perl?
2nd Edition.

OOC, how did you stumble across my posts?
Randal L. Schwartzlivemerlyn on August 28th, 2005 10:49 am (UTC)
Re: which edition of Learning Perl?
Ugh. Get (borrow if you must) the third or fourth edition. Total rewrite from an additional eight years of classroom experience. Much easier to learn.
Randal L. Schwartzlivemerlyn on August 28th, 2005 10:50 am (UTC)
Re: which edition of Learning Perl?
oops... didn't answer everything...

feedster.com is a wonderful thing. I search for "Learning Perl" to see what people are saying about my books.