Dragon Board HCS12 Assembly Language, help

Thread Starter

simon.castillo

Joined Dec 13, 2018
5
I have a group project for school. We are trying to create a poker game that can be played on the dragogboard HCS12. We are using the AsmIDE, and developing in assembly. This is basically my introduction into programming, I have found a decent amount of resources but I am still having issues implementing the ideas on larger scale. I would love some feedback on the code my partner and I have created so far. I realize it is probably sloppy, and inefficient at best. With that being said it is still not complete, and I am generally looking for feedback on my code and the direction I am heading and or possibly resources or guides to better understand assembly. Thanks for your time.
 

Attachments

Thread Starter

simon.castillo

Joined Dec 13, 2018
5
More information I should have included. The program is currently running somewhat. The Idea was that the system would deal 5 cards, the user would select which cards to hold and discard the others and re-deal however many cards were discarded. When you attempt to hold the cards before the re-deal the cards present an N next to the card slot (1-5) indicating that is the card you wish to hold, unfortunately this does not work and the all of the cards will be re dealt. Thanks again any information would be great!
 

MrChips

Joined Oct 2, 2009
30,618
The key to successful coding is to stop writing code.
Don't even think about coding.

Develop your strategy first.
What is your algorithm?

How do you randomize 52 cards?
How do you select n cards from the deck?
How do you remove n cards from the deck so that they cannot be dealt again?
 

Thread Starter

simon.castillo

Joined Dec 13, 2018
5
As of right now we have not been able to get the Random Number generator implemented into the code, so the cards are not randomized.
I was mistaken in my first post, pressing the 4x4 keypad digits (1-5) just adds an N character next to the card slots (1-5), this is to signify that you want a new card, not to hold the card.
Right now I also have not added anything to compare cards that have been dealt or discarded.

I have some very basic flow charts but nothing complete, I apologize again for my ignorance.
 

MrChips

Joined Oct 2, 2009
30,618
Random number generation is just a function call. Treat it is a black box.

Now assume that your cards are randomized.
How are you going to select a card off the top of the deck?
 

Thread Starter

simon.castillo

Joined Dec 13, 2018
5
That is a great question, and one I had not even asked myself yet. I think my issue was from the beginning I have basically been using various subroutines ive been given through example and mashing them together until something works.

Ive attached the most recent version I'm working on (just cleaned it up a little)
 

Attachments

BR-549

Joined Sep 22, 2013
4,928
A deck is a sequential list. So we need some kind of sequential representation for the deck. Once a "list" representation is defined....we need to randomly fill the sequence(shuffle deck).

Then we need to sequentially deal and draw from that sequence.

Then you need your inputs. Deal, draw, discard, Bet, Raise etc.

Then the outputs. Are you using a text screen for output? What about beeper/speaker?

What exactly is your plan?
 
Top