#why arent the variables defined in the main call?

23 messages · Page 1 of 1 (latest)

pale roverBOT
#

@empty crystal

dew135 Uploaded Some Code
Uploaded these files to a Gist
icy wave
#

You never defined them before using them in the call to main

#

So main has no idea what they are

empty crystal
#

How do I define them

#

I thought I did

icy wave
#

Where did you do it?

#

Something like deck = ...

empty crystal
#

deck is defined in line 29

#

deck = []

icy wave
#

But that's in a function which means the main call that's outside the function cannot access it

empty crystal
#

and hand is defined in line 6 then redefined in line 100 and 105

#

oh

icy wave
empty crystal
#

yes

icy wave
#

Really?

empty crystal
#

well youre saying that so now i think maybe not

#

is the answer n

#

no

icy wave
#

Maybe think about it for a bit 😉

empty crystal
#

it has to be an argument in the main function or you wouldnt be able to call fun dealAHand

icy wave
#

But where's you deck coming from?

#

Wait I'm confused

empty crystal
#

makeADeckof52 Function