Computer Science Canada method in a method |
Author: | LiquidDragon [ Sun Jul 18, 2004 11:36 am ] | ||
Post subject: | method in a method | ||
Is it possible to call a method inside another method? I'm making a black jack game and i have one method to choose my card another one to tell them what card they have. My program looks something like this. Only the methods are shown.
Don't worry i have all my variables and stuff set. But im wondering if my card variable (the one i use for storing the number of the random chosen card) should be in the pickCard method or above it. Please help |
Author: | wtd [ Sun Jul 18, 2004 2:34 pm ] | ||
Post subject: | |||
You'll most likely want the card to be represented by an instance variable.
Sort of like that. ![]() |
Author: | Delta [ Sat Jul 24, 2004 7:58 am ] |
Post subject: | |
Quote: Is it possible to call a method inside another method?
Yes it is... but as far as declaring one inside of another... I don't believe so With your program there is no need to declare a method inside a method... it's useless... Have a nice day |
Author: | LiquidDragon [ Sat Jul 24, 2004 5:37 pm ] |
Post subject: | |
Ok my black jack is all finished. I'm just gonna try to add some pictures and make it more interactive. Maybe even worthy of the web ![]() |
: |