Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by hesa2020 · Jun 24, 2012 at 04:13 AM · c#distributionpoker

Poker Game ... Distribute Card

Hi, i want to distribute card to player but not Randomly well : im going to make Bonus Pack who

increase change to get double,

Change to get a higher card

Chance to get a J and a Q

Chance to get a Q and a K etc...

And i want to disable a card if have already been distrued

Here the card i want :

13 hearts: ♥ 2 3 4 5 6 7 8 9 10 J Q K A

13 diamonds: ♦ 2 3 4 5 6 7 8 9 10 J Q K A

13 clubs: ♣ 2 3 4 5 6 7 8 9 10 J Q K A

13 spades: ♠ 2 3 4 5 6 7 8 9 10 J Q K A

I dont know how i can make a function for that ( by the way my game is online and coded in c# ) If you can help me to developp my function it will be awesome

please dont share the Poker Pack, i dont have enough to afford it currently

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fattie · Jun 24, 2012 at 10:03 AM 0
Share

And here's me thinking this question was going to be on the latest research in AI for texas hold 'em.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Mizuho · Jun 24, 2012 at 04:17 AM

If it were me, I would use an array for the deck and one for what has been drawn. Then you don't have to worry about checking whether the card has been distributed or not (it won't be in the deck's array).

Edit: I use this kind of thing to remove value from an array.

 public static T[] remove<T>(this T[] array, T obj) { return array.remove<T>(System.Array.IndexOf(array, obj)); }
 public static T[] remove<T>(this T[] array, int index) {
     T[] newArray = new T[array.Length - 1];
     int a = 0;

     for(int i = 0; i < array.Length; i++) {
         if(i != index) {
             newArray[a] = array[i];
             a++;
         }
     }
     
     return newArray;
 }

Edit: If you don't need compatibility for ancient .NET versions, just use a List instead.

Comment
Add comment · Show 8 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image whydoidoit · Jun 24, 2012 at 04:31 AM 0
Share

@$$anonymous$$izuho - I have just one thing to say: List ;)

avatar image Mizuho · Jun 24, 2012 at 04:46 AM 0
Share

@whydoidoit: The guy I'm working for told me not to use lists when I started, so I have arrays linked to my brain at the moment. Lists would probably be a good a idea for this guy (as long as he doesn't want FULL compatibility for ancient versions).

avatar image Fattie · Jun 24, 2012 at 10:01 AM 1
Share

YOU $$anonymous$$UST USE LIST. DO NOT USE ARRAYS

avatar image Fattie · Jun 24, 2012 at 10:01 AM 1
Share

if you like, I will telephone the "guy you are working for" and straighten him out.

avatar image whydoidoit · Jun 25, 2012 at 04:57 AM 0
Share

@$$anonymous$$izuho - Don't use List :) Wow - next he'll be telling you to not drink water...

Show more comments
avatar image
0

Answer by hesa2020 · Jun 24, 2012 at 04:49 AM

Well i just realized while reading back , not gonna use c# but PHP cuz i want to give card from server side.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fattie · Jun 24, 2012 at 10:02 AM 0
Share

You have won an award for this answer.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

C# Random Stats Distribuition 3 Answers

Making a bubble level (not a game but work tool) 1 Answer

An OS design issue: File types associated with their appropriate programs 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges