|
Yes Colin i saw this warning about long code and i appoligize for that.
May be you are right about bubble sort and it's not be included in code.
My question how to rebuilt this code in "structs". I began programm 4 months
ago and i don't have a lot of skills. But i have to rebuilt this to struct.
i want to do 3 or 4 structs : " Card", "CardDeck", "Hand" and may be "Game".
Card and CardDeck i think allright, but Hand that initializes 5 cards prints
and replaces old card to new not working, i don't know what to do.
May be somebody know source code or links to this.
Tnanks...
|
|
|
|
|
You could have a look at my article [^]about scoring cribbage hands.
Cribbage is a fundamentally different card game from poker, but I show you how to find pairs, flushes and straights...
Share and enjoy.
Sean
|
|
|
|
|
I did it already and i know how to find pairs but i've got confused
how to rebuilt it structs my brother
|
|
|
|
|
Hi,
From database i m getting value like 1,2,3,4,5,6,7,8,9,10,11 upto 9999.
these value i m displaying in combobox
but i want to display like this
if it's 1 to 9 then i have to display 0001.
if it's 10 to 99 then i have to display 0010 upto 0099.
if it's 100 to 999 then i have to display 0100 upto 0999.
if it's 1000 to 9999 then i have to display 1000 upto 9999.
help me it's too urgent.
thanks
asif
|
|
|
|
|
Well I haven't worked with comboboxes but I believe they have two properties, datatextfield and datavaluefield. If so you can do this
combobox.datatextfield = datatable["field"].ToString().PadLeft(4,'0');
-----
|
|
|
|
|
comboBox1.Text = comboBox1.Text.ToString().PadLeft(4, '0');
|
|
|
|
|
hi,
i am using Datagrid view in my project..
and i have got 3 columns..
but in one of the 3 columns i want formated data in one of the column like..
000.000.000.000
user should enetr the number only..
how can do it..
pls help me
With Regards
prasad
|
|
|
|
|
Gents,
I have a combobox that contains operations (Range, >, < and =). The user should select needed opertion to process some text fields. How can I get the operation selected to put in the if statment. For example, here is a '>' is selected:
if (DoubleA > DoubleB)
I want to do it in efficient way because i have many comparisons based on user selection.
Thanks for your assistance in advance.
|
|
|
|
|
A little OO thinking helps.
abstract class FilterBase
{
public abstract bool PerformOperator(int a, int b);
}
public class EqualsFilter : FilterBase
{
public bool PerformOperator(int a, int b);
{
return (a == b);
}
}
The above is an example of the strategy pattern.
Each item in the combo box is assosiated with a specific instance of the Filter class (or rather one of its derived varients). Because the FilterBase class cotains the methods needed, that is all you ever need to reference. Once set up the rest of the code does not need to know anything about each of the specialised classes.
|
|
|
|
|
Thank you thats was really helpfull to solve my issue
|
|
|
|
|
hi
i want to embedding any exe file(s) to resource at runTime (by code) and extract it to drive and run it, but how to do ?
thanks
|
|
|
|
|
You cannot. Resources are built at compile time.
|
|
|
|
|
Im looking for the board game ludo in c#. Or another board game like it with source files. If somebody knows it let me know..Thx
C#C#C#C#C#C#C#C#C#C#C#C#
|
|
|
|
|
I doubt there is one but you are welcome to build your own and ask here if you have any questions
|
|
|
|
|
www.techipost.com/opensource-ludo-game-c-csharp/
|
|
|
|
|
|
for: break
do: break
while: break
if: no keyword to exit
read a book on C# !
|
|
|
|
|
i guess there is a return;
for example,
if(x<3)
return;
try it
|
|
|
|
|
break to exit from for.
There is nothing to break out of if since it is not a loop but a conditional directive.
|
|
|
|
|
Hi,
What is the best way to plot graphs in C# ?
Can crystal reports in VS 2005 be used for the same ?
Thanks in Advance
|
|
|
|
|
hi all,
i'm using hash table which has one key and one value, but i need to get two keys and one values now,
is there is any collection available for this, suggest me
thnks in advance
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
why don't you concatenate both keys using some special character delimiter and use them as a single key.
Regards
Shajeel
|
|
|
|
|
Try creating a collection of collections, this can be used to do what you want.
There is no "standard" multi-key collection class, and I think this is because its easy and valid to implement your own.
|
|
|
|
|
I have a class, let us say Customer which has a set of properties. I am using this class that is in a common dll in two different services (say Service1,Service2). Now i have a windows application (say WinApplication1)where i am adding reference to both the Services. So i have access to the Customer object in two differenct ways.
1) WinApplication1.Service1.Customer
2) WinApplication1.Service2.Customer
In my application i want to get a customer object from this service and pass it into the other service as an input. But i am getting casting problem.
It says "Cannot implicitly convert type WinApplication1.Service1.Customer to WinApplication1.Service2.Customer"
Please let me know if there is a easy way to do this conversion?
Srivatsan
|
|
|
|
|
You appear to have defined Customer twice. Once in each service. You should place Customer in its own Class Library project and then reference it from any other project that needs it. Assuming Customer is identical in each of the existing projects this should work fairly easily. However, if Customer in each of the existing projects, is the same in name only then you have a lot of work ahead of you to redesign your application.
|
|
|
|