code logs -> 2008 -> Sat, 25 Oct 2008< code.20081024.log - code.20081026.log >
--- Log opened Sat Oct 25 00:00:27 2008
00:02 AnnoDomini [~farkoff@Nightstar-29309.neoplus.adsl.tpnet.pl] has quit [Quit: ...and when Mr. Bigglesworth gets upset, people die!]
00:03 Consul [~consul@Nightstar-3799.dsl.sfldmi.ameritech.net] has quit [Ping Timeout]
00:04 Consul [~consul@Nightstar-3044.dsl.sfldmi.ameritech.net] has joined #code
00:21 Reivles [~reaverta@Admin.Nightstar.Net] has joined #Code
00:23 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
01:49 Vash[Out] is now known as Vash
01:58 Serah [~Z@Nightstar-5401.atm2-0-1041217.0xc329e232.boanxx12.customer.tele.dk] has joined #Code
01:58 mode/#code [+o Serah] by ChanServ
02:02 Attilla [~The.Attil@Nightstar-9469.cdif.cable.ntl.com] has quit [Quit: <Insert Humorous and/or serious exit message here>]
02:59
<@gnolam>
Hmm. The Longest Journey wins at sound editing.
03:00
<@gnolam>
An ambient "trotting horse" sound actually had me looking out the window for a while.
03:57 Serah [~Z@Nightstar-5401.atm2-0-1041217.0xc329e232.boanxx12.customer.tele.dk] has quit [Killed (NickServ (GHOST command used by ZLOK))]
03:57 Serah [~Z@Nightstar-5401.atm2-0-1041217.0xc329e232.boanxx12.customer.tele.dk] has joined #Code
03:57 mode/#code [+o Serah] by ChanServ
03:58 Netsplit Troika.TX.US.Nightstar.Net <-> Blargh.CA.US.Nightstar.Net quits: @MyCatVerbs, @crem
04:06 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: Z?]
04:33
<@Serah>
I need help with a project. I need to figure out how to make a spring loaded ballista with multiple barrels.
04:34
<@Vornicus>
Ballistae are generally just large crossbows. I recommend you look at how they make repeating crossbows.
04:35
<@Serah>
Hmm, but it needs multiple barrels, and I need a mechanism to cock all springs at once.
04:36
<@Serah>
I'm probably going with a 4 barrel height 6 barrel width.
04:36
<@Serah>
It needs to shoot waterballoons.
04:36
<@Shoukanjuu>
I'd recommend a turning knob
04:36
<@Shoukanjuu>
...
04:36
<@Shoukanjuu>
I'd recommend a handcrank
04:36
<@Vornicus>
...how do you shoot waterballoons with a ballista? Ballistae have a short acceleration area.
04:36
<@Shoukanjuu>
And slotted uh...hammers
04:37
<@Shoukanjuu>
yeah, it just won't work very well
04:37
<@Shoukanjuu>
But it'll shoot
04:37
<@Shoukanjuu>
Won't go that far, but it will
04:37
<@Serah>
We're having a concert/party/event/whatever next summer, and some of us thought it'd be cool, I have a couple of handymen and a carpenter who is willing to make it if I can schematicize it.
04:37
<@Vornicus>
Shou: I'm more referring to the fact that if you overaccelerate a balloon you'll pop it in the barrel.
04:37
<@Serah>
It doesn't need to go more than 20m and the impact must be nonlethal.
04:37
<@Shoukanjuu>
Vorn: Yeah, that's what I'm thinking will happen
04:37
<@Serah>
And preferrably below bruising area >_>
04:38
<@Shoukanjuu>
I don't think your'e getting 20 meters out of this
04:38
<@Shoukanjuu>
Instead, trebuchet.
04:38
<@Serah>
We may work out the kinks with the delivery system later, sponges are also an option.
04:38
<@Serah>
Trebuchet is too heavy to effeciently maneuvre around.
04:38
<@Shoukanjuu>
Surely you can make a smaller scale one that still puts a water balloon twenty meters
04:39
<@Serah>
Yes, but one is not many.
04:39
<@Vornicus>
....and you're expecting the proportionately heavier and more complicated ballista to do any better?
04:39
<@Shoukanjuu>
Hrm.
04:39 * Serah goes to lok up a repeatercrossbow.
04:39
<@Shoukanjuu>
:P
04:39
<@Shoukanjuu>
I'm actually thinking of a catapult more and more
04:39
<@Serah>
Yeah, I am.
04:39
<@Shoukanjuu>
PS2 get :3
04:40
<@Shoukanjuu>
I don't think you'll get the power out of something like that
04:40
<@Shoukanjuu>
that you need
04:40
<@Shoukanjuu>
Without a high risk of breaking the balloons
04:40
<@Shoukanjuu>
Instead, golf or tennis balls.
04:40
<@Serah>
Sponges?
04:41
<@Shoukanjuu>
They're significantly harder to pop, and clsoe to the same mass
04:41
<@Shoukanjuu>
Oh, sponges...I suppose that'd work
04:41
<@Serah>
You can get sportsballs made of spongeymass that will hold water.
04:41
<@Shoukanjuu>
I didn't know that. Then again, I think the last time I went outside was about a month ago
04:41
<@Shoukanjuu>
x_X
04:41
<@Serah>
Most of the water will likely be driven away by the acceleration, but that is inconsequencial.
04:41
<@Shoukanjuu>
The sponge would get there, that's the key
04:42
<@Serah>
I've considered having a big "stopper" to force the springs back into position.
04:42
<@Serah>
And I'm considering using car suspension springs.
04:43
<@Serah>
It'd take 5 men to load it, sure, and they'd need gloves. This doesn't bother me.
04:44
<@Shoukanjuu>
I don't remember what they're called, but the notches could be put in the hammer
04:45
<@Shoukanjuu>
and a pair of cranks could be used for all five
04:45
<@Shoukanjuu>
you have a few people loading it, so..
04:45
<@Shoukanjuu>
Since you said it was spring loaded
04:49
<@Serah>
I seem to recall a similar invention in a movie being called a porcupine.
04:49
<@Shoukanjuu>
I have no idea what it's called, but I know it would get the tension from the springs. The next step is how to get the crank/lever/whathaveyou away from it without losing force from the spring
04:50 MyCatVerbs [~mycatverb@Nightstar-13709.lurkingfox.co.uk] has joined #Code
04:50 crem [~moo@Nightstar-28703.adsl.mgts.by] has joined #Code
04:50 mode/#code [+o MyCatVerbs] by ChanServ
04:50
<@Serah>
That is my most major issue.
04:50
<@Serah>
Firing mechanism is easy, loading mechanism is hard.
04:51
<@Serah>
Hmm...
04:52
<@Shoukanjuu>
Ah
04:52
<@Shoukanjuu>
Ypu can bring it back to an acceptable level
04:52
<@Shoukanjuu>
...no, that wouldn't work...
04:52
<@Serah>
?
04:53
<@Shoukanjuu>
Well, it could if you had something holding the spring back that isn't the crank
04:53
<@Shoukanjuu>
or you could just release the crank
04:53
<@Shoukanjuu>
But that can get dangerous
04:53
<@Shoukanjuu>
since there are multiple barrels
04:54
<@Shoukanjuu>
the former option would work
04:54
<@Shoukanjuu>
if there was something holding the spring back and you just....hit it
04:54
<@Shoukanjuu>
Like a levert
04:54
<@Shoukanjuu>
lever*
04:54
<@Shoukanjuu>
and it would release it
04:54
<@Shoukanjuu>
One for every barrel
04:56
<@Serah>
Hmmm...
04:56
<@Serah>
I need to draw something.
05:01
<@Shoukanjuu>
I draw like john madden.
05:01
<@Shoukanjuu>
So...goodluck with that
05:03
<@Serah>
John madden?
05:04
<@Shoukanjuu>
He's...a football announcer
05:04
<@Shoukanjuu>
He draws plays as if to tell people what happened, sometimes
05:04
<@Serah>
Amrican football or soccer football?
05:05
<@Shoukanjuu>
'american'
05:05
<@Serah>
Never heard of him.
05:05
<@Shoukanjuu>
He's horribly inept at describing what happened, though, in both drawing and telling :P
05:05
<@Shoukanjuu>
people joke about it all the time
05:06
<@Shoukanjuu>
hrm...where am I going to get a screwdriver this small without getting a screwdriver this small >:/
05:10 * Shoukanjuu breaks a razor off his shaving razor
05:11
<@Shoukanjuu>
When I grow up, I wanna be just like macgyver
05:11
<@Serah>
And how long till you're grown?
05:11
<@Shoukanjuu>
About 8 years at least.
05:13
<@Shoukanjuu>
they're significantly wider than I thought...curses
05:14
<@Serah>
How old are you again?
05:15
<@Shoukanjuu>
19 :P
05:15
<@Serah>
Oh, then I didn't overshoot you. :p
05:16
<@Shoukanjuu>
How do you mean?
05:16
<@Serah>
Guesstimating your age.
05:16 * Shoukanjuu uses nailclippers to widen an edge from a clothespin's clamp
05:16
<@Shoukanjuu>
you thought I was younger, 18 or so? Why? o:
05:19
<@Shoukanjuu>
.......or I could just use the screwdriver I used to open the thing in the first place ._.
05:22
<@Serah>
I can't explain what estimate or why, but i'm rarely too far off.
05:22
<@Serah>
I can't explain how I do it either.
05:22
<@Serah>
I just do.
05:27
<@Shoukanjuu>
this airport update...
05:27
<@Shoukanjuu>
Sounds like it fixes Airport extreme's problem wi th big networks
05:28
<@Shoukanjuu>
be right back o:
05:29 Shoukanjuu [~Shoukanju@Nightstar-19130.dhcp.embarqhsd.net] has quit [Quit: Shoukanjuu]
05:34 Shoukanjuu [~Shoukanju@Nightstar-19130.dhcp.embarqhsd.net] has joined #code
06:13 Serah [~Z@Nightstar-5401.atm2-0-1041217.0xc329e232.boanxx12.customer.tele.dk] has quit [Quit: Be right back, got some smiting and righteous justice to attend to.]
07:04 Reivles [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
07:06 DBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
07:06 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
07:07 DBot is now known as DiceBot
07:09
< Shoukanjuu>
Rigged some magic key with cardboard and paper
07:10
< Shoukanjuu>
And everything seems to work...!
07:11 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
07:11 mode/#code [+o Reiver] by ChanServ
08:00 Vornicus is now known as Vornicus-Latens
08:03 Consul [~consul@Nightstar-3044.dsl.sfldmi.ameritech.net] has quit [Ping Timeout]
08:05 Consul [~consul@Nightstar-3044.dsl.sfldmi.ameritech.net] has joined #code
08:09 DBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
08:09 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
08:10 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
08:10 DBot is now known as DiceBot
08:16 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
08:16 mode/#code [+o Reiver] by ChanServ
08:37 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
08:43 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
08:43 mode/#code [+o Reiver] by ChanServ
08:51
< Shoukanjuu>
Basking is the summer sun, I greeted the seabirds.
08:51
< Shoukanjuu>
But then...I entered the demon's den.
08:53 AnnoDomini [~farkoff@Nightstar-29309.neoplus.adsl.tpnet.pl] has joined #Code
08:53 mode/#code [+o AnnoDomini] by ChanServ
08:58
< Shoukanjuu>
That was shortlived, but classic R-type, alright.
08:58
< Shoukanjuu>
>:3
08:59
<@McMartin>
R-Type Final?
09:08
< Shoukanjuu>
Indeed
09:09
< Shoukanjuu>
I thought I was smart and awesome, played the first level in R-Typer mode
09:09
< Shoukanjuu>
The boss destroyed me
09:09
< Shoukanjuu>
"Ooh, he's opening up, let's shoot hi-OMGLASER
09:10
< Shoukanjuu>
Then I get past that part on my next life
09:10
< Shoukanjuu>
And get killed by a spike...that happened twice, so gameover
09:11
< Shoukanjuu>
Still, I'll get better. Need a stock controller if I'm going to play it, and my PS2 type is apparently stupid
09:12
< Shoukanjuu>
I looked at a few pics, then opened the stupid thing up and fixed it like it needed to be
09:12 * Shoukanjuu saves twenty dollars by using tape and printerpaper
09:13 Vash [~Vash@Nightstar-29885.dsl.sndg02.sbcglobal.net] has quit [Quit: *poofs into nothingness*]
09:37 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
09:37 DBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
09:38 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
09:39 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
09:41 DBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
09:44 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
09:44 mode/#code [+o Reiver] by ChanServ
09:59 You're now known as TheWatcher
10:42 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
10:43 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
10:49 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
10:49 mode/#code [+o Reiver] by ChanServ
10:51 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
11:46 Attilla [~The.Attil@Nightstar-9469.cdif.cable.ntl.com] has joined #code
11:46 mode/#code [+o Attilla] by ChanServ
12:23 Vornicus-Latens [~vorn@Admin.Nightstar.Net] has quit [Ping Timeout]
12:27 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
12:28 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
12:28 mode/#code [+o Reiver] by ChanServ
12:28 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
12:32 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
12:41 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
12:42 DBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
12:42 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
12:43 DBot is now known as DiceBot
12:48 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
12:48 mode/#code [+o Reiver] by ChanServ
13:03 Attilla [~The.Attil@Nightstar-9469.cdif.cable.ntl.com] has quit [Connection reset by peer]
13:04 Attilla [~The.Attil@Nightstar-9469.cdif.cable.ntl.com] has joined #code
13:04 mode/#code [+o Attilla] by ChanServ
13:40 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
13:40 mode/#code [+o gnolam] by ChanServ
13:40 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
13:41 DBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
13:42 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
13:42 DBot is now known as DiceBot
13:42 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
13:42 mode/#code [+o Reiver] by ChanServ
15:06 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Ping Timeout]
15:06 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
15:06 mode/#code [+o gnolam] by ChanServ
15:07
<@gnolam>
Hey, Armadillo Aerospace actually got their lander working.
15:12 * gnolam stabs Windows Update with a dull dagger.
15:16 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: Reboot]
15:18 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
15:18 mode/#code [+o gnolam] by ChanServ
15:21 * Shoukanjuu messily sews Windows Update up, leaving the dagger blade inside
16:44
<@ToxicFrog>
Shoukanjuu: tape and printer paper?
16:45
< Shoukanjuu>
When I grow up, I wanna be just like Mecgyver : >
16:45
< Shoukanjuu>
Macgyver*
16:49
< Shoukanjuu>
I had no care for warranties, especially because I bought it on ebay, used
16:49
< Shoukanjuu>
No warranty here ?\o_?/?
16:50
< Shoukanjuu>
So I located what the so called "Magic key" did
16:50
< Shoukanjuu>
Two sensors is all that is needed :/ I taped one down because it wasn't near anything in particular
16:50
< Shoukanjuu>
and the other, since it was on the power, I just pushed down with paper and taped over the paper to keep it there
16:51 Attilla [~The.Attil@Nightstar-9469.cdif.cable.ntl.com] has quit [Ping Timeout]
16:51
< Shoukanjuu>
And then I saw that people already do this.
17:04 Attilla [~The.Attil@Nightstar-9469.cdif.cable.ntl.com] has joined #code
17:04 mode/#code [+o Attilla] by ChanServ
17:12 Reivles [~reaverta@Admin.Nightstar.Net] has joined #Code
17:12 DBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
17:14 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
17:14 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
17:15 DBot is now known as DiceBot
17:20
<@ToxicFrog>
Shoukanjuu: and you already have the requisite boot disc?
17:20
< Shoukanjuu>
TF: Naturally.
17:20
<@ToxicFrog>
Handy.
17:21
< Shoukanjuu>
I bought it with a fliptop, thinking that that was all I would need.
17:22
< Shoukanjuu>
Surely it would come with everything you would need to do this. No, not at all.
17:23
< Shoukanjuu>
Instead of admitting my fault and buying the rest of the stuff, I just found ways around it
17:29 Bobsentme [Bobsentme@Nightstar-25923.dsl.sfldmi.sbcglobal.net] has joined #code
17:29
< Bobsentme>
Need help with a PRNG on an extra credit assignment, when someone gets the chance.
17:29
< Bobsentme>
I've got this so far:
17:29
< Bobsentme>
srand(time(NULL));
17:29
< Bobsentme>
Winning_Number= (int)rand() % 36;
17:30
< Bobsentme>
because I'm not sure how to modify the rand() equation to pull a more random set of numbers from 0 to 36 without screwing up the equation.
17:30
< Bobsentme>
Any help would be appreciated.
17:35
<@ToxicFrog>
What is it you're after?
17:35
<@ToxicFrog>
You want to write a better PRNG to replace rand() with?
17:37
< Bobsentme>
Something to help randomize the numbers a bit more than system time, I think.
17:37
<@gnolam>
That will only affect the seed, not the randomness of the numbers themselves.
17:37
<@ToxicFrog>
Quitoe.
17:37
<@ToxicFrog>
*quite.
17:38
<@ToxicFrog>
Although you might want to use (s)random rather than (s)rand, assuming that you're targeting POSIX rather than C89
17:38
< Bobsentme>
Aaaaaand now you've lost me.
17:38 * Bobsentme is writing this for Extra Credit in C programming class.
17:38
<@ToxicFrog>
Which one of us, and when?
17:38
<@gnolam>
As for your question: at least with GNU's libc, the lower bit randomness of rand() is pretty bad (well, all of rand() is bad - if you want a decent PRNG, just go download a Mersenne Twister), so you might want to shift its return a bit to the right before the modulo.
17:39
<@ToxicFrog>
gnolam: actually, glibc rand uses the same algorithm as random()
17:39
<@gnolam>
Yes?
17:39
<@ToxicFrog>
NOTES
17:39
<@ToxicFrog>
The versions of rand() and srand() in the Linux C Library use the same random number generator as random(3) and srandom(3), so the lower-order
17:39
<@ToxicFrog>
bits should be as random as the higher-order bits. However, on older rand() implementations, and on current implementations on different systems,
17:39
<@ToxicFrog>
the lower-order bits are much less random than the higher-order bits. Do not use this function in applications intended to be portable when good
17:39
<@ToxicFrog>
randomness is needed.
17:39
<@ToxicFrog>
No shifting needed.
17:40
<@gnolam>
Is random() even in POSIX? I seem to remember it being completely non-standard.
17:40
<@ToxicFrog>
4.3BSD, POSIX.1-2001
17:40
<@gnolam>
Ah. New addition. :)
17:40
< Bobsentme>
Ok, so library for random is...?
17:41
< Bobsentme>
I'm using the standard stdlib.h for rand.
17:41
<@ToxicFrog>
#include <stdlib.h> and you should be good to go
17:41
<@gnolam>
What platform are you targeting, BTW?
17:41
<@ToxicFrog>
*if* you are on a POSIX.1 system.
17:41
<@ToxicFrog>
If you're targeting, say, windows, all bets are off.
17:41 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
17:41
< Bobsentme>
Windows systems. Just using a console window.
17:41 Reivles [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
17:41
<@ToxicFrog>
O.
17:41
<@gnolam>
I'm assuming MinGW. Then what I said about bitshifting holds.
17:41
<@ToxicFrog>
What development environment?
17:42
< Bobsentme>
Bloodshed Dev-C/C++ compiler.
17:42
< Bobsentme>
Turbo C in class.
17:42
<@ToxicFrog>
Which is mingw based. Ok.
17:42
<@ToxicFrog>
Aah
17:42
<@ToxicFrog>
Ok, in that case we should probably stick to ANSI.
17:42
< Bobsentme>
Ok.
17:43
<@ToxicFrog>
So, as gnolam says, right shift before modulus.
17:43
< Bobsentme>
so...add 1 to random number?
17:43
<@ToxicFrog>
No, right shift.
17:43
<@ToxicFrog>
The >> operator.
17:44
<@ToxicFrog>
Have you used the shift operators before?
17:44
< Bobsentme>
nope.
17:45
< Bobsentme>
I saw a few of those when researching this problem. Not sure how/why they're used.
17:45
<@ToxicFrog>
You are aware how numbers are stored internally, I hope? As byte sequences, which are themselves bit sequences?
17:46 * Bobsentme nods
17:46
< Bobsentme>
First thing we covered.
17:46
<@ToxicFrog>
Ok. (x >> n) is the value of x, with all the bits moved n places to the right.
17:46
<@ToxicFrog>
0x12345678 >> 12 is 0x00012345
17:47
< Bobsentme>
interesting.
17:47
<@ToxicFrog>
<< is the same thing, except it shifts left instead of right.
17:47
< Bobsentme>
ok.
17:47 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
17:47 mode/#code [+o Reiver] by ChanServ
17:48
<@ToxicFrog>
The issue with rand that the man page talks about is that the low order bits are much less random than the high order
17:48
< Bobsentme>
ok.
17:48
<@ToxicFrog>
Eg, high randomness -> 0x12345678 <- low randomness
17:48
<@ToxicFrog>
So the suggestion is to use right shift to discard the low-order bits, demoting the high-order ones into their place and using those.
17:49
<@gnolam>
Since only the lower order bits will matter after the modulo.
17:49
< Bobsentme>
Quite frankly, that seems genius to me.
17:50
< Bobsentme>
But how do I know how many to shift it?
17:51
<@ToxicFrog>
sizeof(int) will get you the size of an int on that system.
17:51
<@ToxicFrog>
(in bytes)
17:51
<@ToxicFrog>
If you want n bits, shift (sizeof(int)*8 - n) to the right.
17:52
<@ToxicFrog>
Make sense?
17:52
< Bobsentme>
Yes!
17:53
< Bobsentme>
Thank you
17:53
<@ToxicFrog>
Pity you aren't targeting linux, then we could just say "read /dev/urandom"
17:53 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
17:53
< Bobsentme>
Yeah, i'm noticing that windows has a severe lack of programming options.
17:54
< Bobsentme>
Well...easy ones, anyways.
17:54
<@ToxicFrog>
But given the constraints...this isn't ideal, but it's reasonably portable and compensates for the most glaring deficiency in rand()
17:54
<@ToxicFrog>
Windows actually has a rather large and well-developed API.
17:54
<@ToxicFrog>
However, it's different from everything else on earth; code using it is completely nonportable.
17:55
<@ToxicFrog>
It's also very poorly documented, IME.
17:55
<@ToxicFrog>
(and then there's the systems hungarian, and the penchant for one function that does everything and takes twelve arguments...)
17:57
<@ToxicFrog>
The typical way one deals with this is to either use ANSI C89 or C99, the lowest common denominator and thus the most portable (which is what we're doing here); use POSIX and target Cygwin or MSYS rather than windows directly; use another compatibility library like SDL; write seperate versions; or just abandon portability.
17:57
<@ToxicFrog>
Constraining ourselves to ANSI C89 is rather cramped, but has the advantage of working goddamn everywhere.
17:57
<@ToxicFrog>
Well, almost everywhere.
17:58
<@ToxicFrog>
There are some embedded systems that are missing <stdio.h>, for example.
18:00 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
18:00 mode/#code [+o Reiver] by ChanServ
18:00
<@ToxicFrog>
Windows programming looks harder than it is because of the initial setup cost, I think. *nix systems tend to come with a toolchain and developer documentation, or can install same with a single gesture.
18:01 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
18:07 * Bobsentme nods
18:22 Vornotron [~vorn@Admin.Nightstar.Net] has joined #code
18:22 Vornotron is now known as Vornicus
18:38 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
18:45 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
18:45 mode/#code [+o Reiver] by ChanServ
19:46
< Bobsentme>
For the record: 245 lines of code to write a Roulette game program.
19:47
< Bobsentme>
And that's without determining black / white.
19:47
< Bobsentme>
err..black/red.
19:47
< Vornicus>
Black/Red is then just a 246th line.
19:47
< Bobsentme>
(It does, however, let you bet on odds/even)
19:48
< Vornicus>
well, okay, probably mroe than that.
19:48
< Bobsentme>
yes.
19:48
< Bobsentme>
WAAAY more than one line.
19:48
< Vornicus>
But, the important question: what language?
19:48
< Bobsentme>
C
19:48
< Vornicus>
aha.
19:48
< Bobsentme>
Now, quick question: Do Pointers count as local variables?
19:49
< Bobsentme>
(one of the rules for this extra credit assignment is to use only local variables)
19:50
< Bobsentme>
Also, not sure Pastebin's limits, but I'd be happy to paste bin this if anyone wants to point out flaws of my code.
19:50
< Vornicus>
I hope so. But honestly for Roulette I'd have a const global table of structs defining the various possible outcomes.
20:05 mode/#code [+v Bobsentme] by gnolam
20:07
<@gnolam>
Shoot.
20:07
<+Bobsentme>
thanks
20:08
<+Bobsentme>
http://rafb.net/p/nD57qp21.html
20:14
< Vornicus>
s/Evan/Even/
20:14
<+Bobsentme>
doh.
20:15
<@gnolam>
The first thing that comes to mind is that a void main() is illegal. :P
20:15
< Vornicus>
yeah, in C it should be int main
20:16
<+Bobsentme>
teacher is actually teaching us that void main (void) is proper. (I understand it's illegal everywhere else, but teacher insists this is right for her class)
20:16
<@gnolam>
And I personally find anonymous prototypes hideous, but eh, taste varies.
20:16
<@gnolam>
Your teacher is wrong.
20:17 * Bobsentme nods.
20:17
< Vornicus>
And yeah, I have to agree with gnolam on the anonymous prototypes too
20:18
< Vornicus>
Mainly because the caller needs more context than the type of the input.
20:18
<+Bobsentme>
Anonymous meaning the int %function (int) lines?
20:18
< Vornicus>
Yeah.
20:18
< Vornicus>
compare:
20:18
< Vornicus>
int Figure_Winnings(int,int,int,int,int,int);
20:18
<+Bobsentme>
ok, that is yet another unfortunate teaching from C programming class.
20:18
<@gnolam>
Also, the *SingleNumPTR and *DozenPTR pointers in main are unused and unnecessary.
20:18
< Vornicus>
int Figure_Winnings(int Dozen, int Winning_Number,int Total_Winnings, int BetType, int BetAmt, int SingleNum);
20:21
<@gnolam>
And srand(time(NULL)) should be called just once, at the start of the program. Not for each rand() call.
20:21
< Vornicus>
Bruce Schneier can van eck phreak Waldo on every page from three bookshelves away.
20:21
<+Bobsentme>
?
20:21
<+Bobsentme>
wow, I've seen people go crazy over code, but didn't mean to send vorn over the edge with mine.
20:22
<@gnolam>
Bruce Schneier knows Alice and Bob's shared secret.
20:22
<@McMartin>
What is this, Bruce Scneier Facts?
20:23
< Vornicus>
Actually yes.
20:25
<+Bobsentme>
Alright, fixed.
20:25 * Bobsentme is considering himself done with this, as he's already lost 7 hours to it (and had a damn fun time doing it, but still)
20:29 * Bobsentme is away: Chores!
20:29
<+Bobsentme>
Thanks guys.
20:29
<+Bobsentme>
as always, your input/output is appreciated.
20:43
<@AnnoDomini>
Vornicus: Vornwiki down. Anno sad. :(
20:45
< Vornicus>
fixed
20:48
<@AnnoDomini>
Thank you.
20:50 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
20:51 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
20:54 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
20:58 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
20:58 mode/#code [+o Reiver] by ChanServ
21:04 DBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
21:05 * Vornicus fiddles with KB.
21:05 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
21:05 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
21:06 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
21:07 DBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
21:12 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
21:12 mode/#code [+o Reiver] by ChanServ
21:19 Consul [~consul@Nightstar-3044.dsl.sfldmi.ameritech.net] has quit [Quit: Leaving]
21:33 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
21:35 DBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has joined #Code
21:36 DiceBot [~Reiver@Nightstar-14540.xdsl.xnet.co.nz] has quit [Ping Timeout]
21:36 DBot is now known as DiceBot
21:40 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
21:40 mode/#code [+o Reiver] by ChanServ
22:05 * Vornicus gets his first results back from his data analysis, discovers that KB does in fact guarantee that all 14 spells are available for purchase.
22:05
< Shoukanjuu>
I don't know how to make codes for dynamic memory addresses.
22:05
< Shoukanjuu>
[/woe]
22:10 Serah [~Z@Nightstar-5401.atm2-0-1041217.0xc329e232.boanxx12.customer.tele.dk] has joined #Code
22:10 mode/#code [+o Serah] by ChanServ
22:20 * ToxicFrog eyebrows at Shou
22:21 AnnoDomini [~farkoff@Nightstar-29309.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
22:23
< Shoukanjuu>
Star Ocean is filled with DMA. SP, EXP, money...I don't remember it being this hard for anything else
22:23
< Shoukanjuu>
Then again, I don't remember making codes and finding out that nobody else made them, toto, either
22:23
< Shoukanjuu>
too*
22:24
< Shoukanjuu>
Eitherway, I'm exhausted.
22:24 Shoukanjuu is now known as Shou|Sofargone
22:27 AnnoDomini [~farkoff@Nightstar-29568.neoplus.adsl.tpnet.pl] has joined #Code
22:27 mode/#code [+o AnnoDomini] by ChanServ
22:46 Bobsentme [Bobsentme@Nightstar-25923.dsl.sfldmi.sbcglobal.net] has quit [Quit: Now running PassedOut.bat]
23:06 * Vornicus quietly makes 320 files for testing.
--- Log closed Sun Oct 26 00:00:10 2008
code logs -> 2008 -> Sat, 25 Oct 2008< code.20081024.log - code.20081026.log >