C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 30th, 2006, 02:32 PM
brad sue brad sue is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 41 brad sue User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 49 m 31 sec
Reputation Power: 3
Sequence

Hi, please can someone help me with this.

I want to write a function sequence that returns 1 when a set of 5 cards appear in sequence ; 0 is not.

I dont understand very well what to do here.

the sequence is 2,3,4,5,6,7,8,9,10,jack,queen,king, with ace considered as either before 2 or after king as needed

For example the set of cards( given as follow):

two of diamonds
four of clubs
six of hearts
three of hearts
five of spades

must have sequence =1;

but for the set of cards:

two of spades
king of spades
ace of clubs
three of diamonds
five of hearts

must have sequnce =0
I give this second example since I do not understand why the sequence is 0 here.

Can someone explain me what sequence means and give me some suggestions to write the function called sequence??
Please do not use structure

Thank you for your time.
B

Reply With Quote
  #2  
Old March 30th, 2006, 05:56 PM
Cirus Cirus is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 276 Cirus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 11 h 48 m 58 sec
Reputation Power: 4
Quote:
Originally Posted by brad sue
Hi, please can someone help me with this.

I want to write a function sequence that returns 1 when a set of 5 cards appear in sequence ; 0 is not.

I dont understand very well what to do here.

the sequence is 2,3,4,5,6,7,8,9,10,jack,queen,king, with ace considered as either before 2 or after king as needed

For example the set of cards( given as follow):

two of diamonds
four of clubs
six of hearts
three of hearts
five of spades

must have sequence =1;

but for the set of cards:

two of spades
king of spades
ace of clubs
three of diamonds
five of hearts

must have sequnce =0
I give this second example since I do not understand why the sequence is 0 here.

Can someone explain me what sequence means and give me some suggestions to write the function called sequence??
Please do not use structure

Thank you for your time.
B


To me example one looks doubtful becuase card 4th is not in sequence.

By sequence I guess the card should appear as ordered in terms of its face value.

that is in the first example, first 3 cards are in sequence in the sence that it has increasing face value.

If you see secnd example carefully, the cards are forming a ring sequence since 2 < King < Ace < three , Five

i.e till king value is increasing and then decreasing ( Ace ) and then increasing.

Since "Ace" is the only card that act as a ring card.

Reply With Quote
  #3  
Old March 30th, 2006, 08:17 PM
brad sue brad sue is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 41 brad sue User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 49 m 31 sec
Reputation Power: 3
Quote:
Originally Posted by Cirus
To me example one looks doubtful becuase card 4th is not in sequence.

By sequence I guess the card should appear as ordered in terms of its face value.

that is in the first example, first 3 cards are in sequence in the sence that it has increasing face value.

If you see secnd example carefully, the cards are forming a ring sequence since 2 < King < Ace < three , Five

i.e till king value is increasing and then decreasing ( Ace ) and then increasing.

Since "Ace" is the only card that act as a ring card.


Thank you,
this means that I need to make a special case where ACE is at the beginning and ACE at the end in my function, right?

Reply With Quote
  #4  
Old March 31st, 2006, 02:13 AM
Cirus Cirus is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 276 Cirus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 11 h 48 m 58 sec
Reputation Power: 4
Quote:
Originally Posted by brad sue
Thank you,
this means that I need to make a special case where ACE is at the beginning and ACE at the end in my function, right?


Yes . Ace is the special card.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Sequence


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT