The Dink Network

Reply to Re: Dink can't calculate

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
January 3rd 2004, 06:18 PM
wizardb.gif
merlin
Peasant He/Him
 
I got bored, so I wrote it for you in C++. Hope you can convert it to Dink.

#include <iostream>

int main()
{
int life = 25;
int iHundred = (life % 10);
int iTen = (life / 10);
int iOne = (life % 10);
int ishoot = 0;
int iFoo = 0;

while(iFoo < 10) {
if(iOne >= 10)
{
iTen++; iOne -= 10;
}

if(iTen >= 10)
{
ishoot++;
iTen -= 10;
}

if(iHundred >= 10)
{
ishoot++;
iHundred -= 10;
}

iFoo++; // Checks to make sure One is the correct value. // The most this can be done is 10 times.
}

std::cout << ishoot << std::endl;
std::cout << iTen << std::endl;
std::cout << iOne << std::endl;

return 0;
}

Note: This code takes the long way around the bush for (somewhat) compatibility with dink.

PSST!! REDINK!! We need a [CODE],[/CODE]-type thing that won't screw up the formatting.