Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Even or odd code

Author
Message
Francesco
20
Years of Service
User Offline
Joined: 11th Apr 2004
Location: Milan, Italy
Posted: 10th May 2004 20:57
Does anybody have a code that tells you if a number is even or odd?? For Dark Basic Classic if possible.
THANKS!!!!

Non si inalberi mica con me, sa!
Lei è venuto qui, lei ha il tombino intasato!
Siamo uno spurgo serio, noi!
Soy Cocktail
20
Years of Service
User Offline
Joined: 23rd Dec 2003
Location:
Posted: 10th May 2004 21:09
i use darkbasic pro so i wouldnt know the code by i think you could devide the number by 2 and if it is a whole number it is even if it isint a whole number its odd
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 10th May 2004 21:09
mod the number by two
0=even
1 = odd


* DBP_NETLIB_v1 - VB.NET PLUGIN FOR DBP * Click Logo
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 10th May 2004 21:11 Edited at: 10th May 2004 21:11
0 mod 2 = 0
1 mod 2 = 1
2 mod 2 = 0
3 mod 2 = 1

see a pattern here?
I named my company based on the 1's/0's reference mod2software, LLC


* DBP_NETLIB_v1 - VB.NET PLUGIN FOR DBP * Click Logo
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 10th May 2004 21:11
In DBPro it is the following. Don't know if it works in DB Classic



Boo!
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 10th May 2004 21:14
@CattleRustler - nice bit of quick editing. Luckily noone else spotted you putting 3 mod 2 = 0

I did though!

Boo!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 10th May 2004 21:36
yeah I posted and then saw that



* DBP_NETLIB_v1 - VB.NET PLUGIN FOR DBP * Click Logo
comando 300
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 11th May 2004 00:23
I wrote this one



CURRENT PROJECT: RETRO PAC-MAN
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th May 2004 01:10



* DBP_NETLIB_v1 - VB.NET PLUGIN FOR DBP * Click Logo
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 11th May 2004 01:21
Lol, the MOD command doesn't work in DBC, comando 300's code is probably the best way to do it in DBC ^_^

Its not a bug, its a feature!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th May 2004 01:33
oh, dbc - sorry


* DBP_NETLIB_v1 - VB.NET PLUGIN FOR DBP * Click Logo
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 11th May 2004 01:56
I guess you could use something like this as well.



i won't see you in the pit
Francesco
20
Years of Service
User Offline
Joined: 11th Apr 2004
Location: Milan, Italy
Posted: 11th May 2004 17:39
Well, thanks to all of you, even though I used Commando 300 code (I actually got to it by myself yesterday evening and then saw it again this afternoon on the forum).
Cheers!
Francesco

Non si inalberi mica con me, sa!
Lei è venuto qui, lei ha il tombino intasato!
Siamo uno spurgo serio, noi!

Login to post a reply

Server time is: 2024-11-26 16:29:52
Your offset time is: 2024-11-26 16:29:52