Test poker hand by using edit text boxes GUI
Mostra commenti meno recenti
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')
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Creating, Deleting, and Querying Graphics Objects in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!