Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Divisible statements.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Jamestomo
How do I cheat?
Reputation: 0

Joined: 14 Mar 2007
Posts: 7

PostPosted: Tue Oct 21, 2008 7:52 am    Post subject: Divisible statements. Reply with quote

hi, i'm quite new to java programming and have a question 'x equal to y and z is not divisible by 2.

I know the first bit is: if((x==y&&

but i'm not too sure how to add the 'z is not divisible by 2' part, can someone help me please?


Last edited by Jamestomo on Tue Oct 21, 2008 7:53 am; edited 1 time in total
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Tue Oct 21, 2008 7:53 am    Post subject: Reply with quote

Lame

% == 0

Now gtfo and do your assignment yourself
Back to top
View user's profile Send private message MSN Messenger
SilentStorm
Cheater
Reputation: 0

Joined: 01 Oct 2008
Posts: 27

PostPosted: Tue Oct 21, 2008 2:00 pm    Post subject: Reply with quote

noz3001 wrote:
% == 0

Actually, a more efficient way would be just to test bit 0:

Code:
if( (x==y) && !((z & 1)==0) )
{
}


Of course, in the days of the 4 GHz multi-core processors, efficiency is a dying art, I know. Sad


Edit: The above is C. Translate boolean and logical operators to Java if necessary. Also, an operation could be removed to make it even more efficient by propagating the 'not' operation [i.e., (z&1) != 0], but I leave it in for the sake of clarity.
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Tue Oct 21, 2008 2:29 pm    Post subject: Reply with quote

SilentStorm wrote:
noz3001 wrote:
% == 0

Actually, a more efficient way would be just to test bit 0:

Code:
if( (x==y) && !((z & 1)==0) )
{
}


Of course, in the days of the 4 GHz multi-core processors, efficiency is a dying art, I know. Sad


Edit: The above is C. Translate boolean and logical operators to Java if necessary. Also, an operation could be removed to make it even more efficient by propagating the 'not' operation [i.e., (z&1) != 0], but I leave it in for the sake of clarity.


Screw efficiency, we're doing java here. If he gave that in it'd be obvious he didn't do it himself.
Back to top
View user's profile Send private message MSN Messenger
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Tue Oct 21, 2008 2:45 pm    Post subject: Reply with quote

Atleast he's not asking us to do it all.
To expand: the modulus (%) operator will give you the remainder of a division.
10%3 would be 1

_________________
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Tue Oct 21, 2008 3:46 pm    Post subject: Reply with quote

HalfPrime wrote:
Atleast he's not asking us to do it all.
To expand: the modulus (%) operator will give you the remainder of a division.
10%3 would be 1


No, he asked me.
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites