Go to Post (Funding will be plentiful...) Where is this magical land? We can move our team there! - Tungrus [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2015, 11:51
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Button Sequence Input

Quote:
Originally Posted by cgmv123 View Post
Code:
int state = 0;

while{
if buttonA && state == 0
state ++;

if buttonB && state == 1
state ++;

if buttonX && state == 2
state++;

if buttonY && state == 3
state ++;

if buttonBack
state = 0;

if state == 4
{action
state = 0;
}
This is Java-focused pseudocode, but it should be enough to get you started.
Shouldn't the state be reset to 0 if a button not in the A B X Y sequence is pressed?

As the code stands, the sequence A B Z X Y would be accepted.


Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:57.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi