Test poker hand by using edit text boxes GUI
Afficher commentaires plus anciens
For a project for my engineering class we are supposed to make a helper to any game. I chose poker and I am having trouble simplifying the conditions such that I do not have to test every possible hand manually. In my function I call get the string of the text boxes (Ace=1,King=2,Queen=3, etc.). I need help on testing the conditions (what card they are) of the edit text boxes and displaying the correct hand output. If more information is needed please let me know!
function pushbutton2_Callback(hObject, eventdata, handles)
box1=str2double(get(handles.edit1,'string'));
box2=str2double(get(handles.edit2,'string'));
box3=str2double(get(handles.edit3,'string'));
box4=str2double(get(handles.edit4,'string'));
box5=str2double(get(handles.edit5,'string'));
box6=str2double(get(handles.edit6,'string'));
box7=str2double(get(handles.edit7,'string'));
if box1==1 && box2==2 && box3==3 && box6==4 && box7==5
set(handles.Hand,'string','Royal Flush')
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!