Author Topic: (no subject)  (Read 1942 times)

Number Eight

  • Member
  • *
  • Posts: 945
    • View Profile
(no subject)
« on: March 14, 2005, 08:14:37 PM »
Is there a way I can code a method to find out whether a number is even or odd in TK2?

 Thanks for any help.
« Last Edit: December 31, 1969, 06:00:00 PM by Number Eight »
<a href=\'http://www.rammstein.com/Extras/\' target=\'_blank\'></a>
<a href=\'http://www.wakeupwalmart.com/\' target=\'_blank\'></a>
<span style=\'font-size:14pt;line-height:100%\'><a href=\'http://www.ebaumsworldsucks.com/\' target=\'_blank\'>ebaumsworld sucks</a>
<a href=\'http://www.uweflade.de/rammstein.htm\' target=\'_blank\'>benzin</a>
</span>

 TE QUIERO PUTA!

Xorlak

  • Administrator
  • Member
  • *****
  • Posts: 2225
    • View Profile
    • http://darkagegames.net
(no subject)
« Reply #1 on: March 14, 2005, 09:50:13 PM »
Hmmm, TK2 doesn't have a modulo command...

Let's see...

Code: [Select]
#method iseven(number!)
{
#even! = 0
#half! = number! / 2
#castint(half!, test!)
#if(half! == test!){#even!=1}
}

That will set 'even!' to 1 if 'number!' is even, 0 if it's odd.
« Last Edit: December 31, 1969, 06:00:00 PM by Xorlak »

Colin

  • Member
  • *
  • Posts: 299
    • View Profile
(no subject)
« Reply #2 on: March 15, 2005, 12:42:45 AM »
TK3 has the C % operator. *grin*

...as well as the complete C++ operator set (not without the scope resolution operator, of course Smile)

Switch now!
« Last Edit: December 31, 1969, 06:00:00 PM by Colin »
— Colin

Dude Man

  • Member
  • *
  • Posts: 6393
    • View Profile
    • http://dmdgames.mysticsoftware.net//
(no subject)
« Reply #3 on: March 15, 2005, 11:12:39 AM »
I believe he's been saying that he can't use TK3 for the past year.

Stop trying to convert everyone to TK3 with your evil propaganda!

TK2 4 evr!!!1 Razz

I'm kidding TK3 is awsome. Wink


Anyways, that looks like a dandy method Xorlak, I wonder, what Number Eight needs it for. *puts on black jumpsuit and places spy cams in #8's house*
« Last Edit: December 31, 1969, 06:00:00 PM by Dude Man »
~Welcome back mysticsoftware.net??
The Black Walkway

Number Eight

  • Member
  • *
  • Posts: 945
    • View Profile
(no subject)
« Reply #4 on: March 15, 2005, 03:26:44 PM »
Xorlak: Thanks for that method. You'll be in the credits Wink

 Dude Man: NO! You shall never see! *hides computer*
« Last Edit: December 31, 1969, 06:00:00 PM by Number Eight »
<a href=\'http://www.rammstein.com/Extras/\' target=\'_blank\'></a>
<a href=\'http://www.wakeupwalmart.com/\' target=\'_blank\'></a>
<span style=\'font-size:14pt;line-height:100%\'><a href=\'http://www.ebaumsworldsucks.com/\' target=\'_blank\'>ebaumsworld sucks</a>
<a href=\'http://www.uweflade.de/rammstein.htm\' target=\'_blank\'>benzin</a>
</span>

 TE QUIERO PUTA!