Reply to Re: Before...
If you don't have an account, just leave the password field blank.
DinkC "simple do-while loop"
The only programming tool I have is Code-Blocks (it's actually a full IDE), and I'm not familiar with the debugger for it. Plus an awfully slow connection doesn't help. I didn't have the time to test these things. I've written a single script in C (which I'm also not familiar with), and so far the output is rotten. Will continue to work on it.
Edit
I don't know where modulo function is. Basic idea is this:
Again I'll use 12 (1100)
x / 2 = some_number + remainder
12 / 2 = 6 + 0
6 / 2 = 3 + 0
3 / 2 = 1 + 1
1 / 2 = 0 + 1
As you can see, the remainder list is a reverse binary form. I don't think we need to reverse it back. It'll function in pretty much the same way, but without complications. Sooo:
And a pseudo DinkC:
The only programming tool I have is Code-Blocks (it's actually a full IDE), and I'm not familiar with the debugger for it. Plus an awfully slow connection doesn't help. I didn't have the time to test these things. I've written a single script in C (which I'm also not familiar with), and so far the output is rotten. Will continue to work on it.
Edit
I don't know where modulo function is. Basic idea is this:
Again I'll use 12 (1100)
x / 2 = some_number + remainder
12 / 2 = 6 + 0
6 / 2 = 3 + 0
3 / 2 = 1 + 1
1 / 2 = 0 + 1
As you can see, the remainder list is a reverse binary form. I don't think we need to reverse it back. It'll function in pretty much the same way, but without complications. Sooo:
void hit(void) { int &number = 12; int &count = 3; int &crap = &number; loop: if(&count > 0) { &crap % 2; // this is where modulo function should be &crap / 2; &count -= 1; say("&crap", 1); wait(200); goto loop; } else { say(&crap); } }
And a pseudo DinkC:
void binary(&counter) { int &crap = &global_var // &global_var is your global variable, so it shouldn't be // passed as parameter since it is accessible everywhere... right? loop: if(&counter > 0) { &crap / 2; &count -= 1; say("&crap", 1); wait(200); goto loop; } else { // another helping global var to catch the output &another_global = modulo(&crap); } }