Simple problem, I hope...
Hi, I'm new to programming in general and I'm attempting to write a text based game of black jack for a bit of practice. I've just started the project and run into something weird that I really can't explain. So far all I'm doing is defining a function that creates a data structure database for each individual card and having the main function print the suit and a number value corresponding to how many "cards" are in the deck. I can't figure out why it spits back junk for cards 2 - 7 and then proceeds to print correctly. Any ideas? When it prints, it looks like this:
Code:
h deckValue = 1
deckValue = 1
\304 deckValue = -1809827132
\206 deckValue = -1605732986
\206 deckValue = -1605732986
deckValue = 2139062143
h deckValue = 32639
h deckValue = 8
h deckValue = 9
h deckValue = 10
h deckValue = 11
h deckValue = 12
h deckValue = 13
d deckValue = 14
d deckValue = 15
d deckValue = 16
d deckValue = 17
d deckValue = 18
d deckValue = 19
d deckValue = 20
d deckValue = 21
d deckValue = 22
d deckValue = 23
d deckValue = 24
d deckValue = 25
d deckValue = 26
c deckValue = 27
c deckValue = 28
c deckValue = 29
c deckValue = 30
c deckValue = 31
c deckValue = 32
c deckValue = 33
c deckValue = 34
c deckValue = 35
c deckValue = 36
c deckValue = 37
c deckValue = 38
c deckValue = 39
s deckValue = 40
s deckValue = 41
s deckValue = 42
s deckValue = 43
s deckValue = 44
s deckValue = 45
s deckValue = 46
s deckValue = 47
s deckValue = 48
s deckValue = 49
s deckValue = 50
s deckValue = 51
s deckValue = 52