Click here to Skip to main content
14,242,633 members
   

Java

 
GeneralRe: g.drawString is not printing the correct value in Jpanel. Pin
chandra12212-Apr-19 22:57
memberchandra12212-Apr-19 22:57 
GeneralRe: g.drawString is not printing the correct value in Jpanel. Pin
Richard MacCutchan12-Apr-19 23:23
protectorRichard MacCutchan12-Apr-19 23:23 
QuestionPreview implementing 10 cross validation Pin
Member 142144734-Apr-19 22:41
memberMember 142144734-Apr-19 22:41 
QuestionGlobal variables are not supported in C# Pin
Brian_TheLion27-Mar-19 21:04
memberBrian_TheLion27-Mar-19 21:04 
AnswerRe: Global variables are not supported in C# Pin
Richard MacCutchan27-Mar-19 22:26
protectorRichard MacCutchan27-Mar-19 22:26 
GeneralRe: Global variables are not supported in C# Pin
Brian_TheLion27-Mar-19 23:40
memberBrian_TheLion27-Mar-19 23:40 
GeneralRe: Global variables are not supported in C# Pin
Richard MacCutchan27-Mar-19 23:45
protectorRichard MacCutchan27-Mar-19 23:45 
GeneralRe: Global variables are not supported in C# Pin
Brian_TheLion27-Mar-19 23:58
memberBrian_TheLion27-Mar-19 23:58 
Hi Richard.

I started by using procedures but then found that I was adding a lot of variables to the procedure.

Here is an example


public void GameUpdate(int Score, int PlayerHealth, int PlayerLoad, String [] RoomName, String [] RoomDescription, int CurrentRoom, String [] ObjectName, int [] ObjectLoc, int GameCounter, int numObjects)

I then tried a better way so all I had to do was call the procedure as I needed to call this procedure several times during the game.

public void GameUpdate()

but as Global variables are not possible then I may have to look at using classes.
My variables such as RoomName needs to be used in several classes so if I was to use

Inventory ADV = new Inventory;
ADV.ObjectLocation = 3;

than as far as I know ADV can only be used in the Inventory class and not other classes.

Brian
GeneralRe: Global variables are not supported in C# Pin
Richard MacCutchan28-Mar-19 0:03
protectorRichard MacCutchan28-Mar-19 0:03 
GeneralRe: Global variables are not supported in C# Pin
Brian_TheLion28-Mar-19 0:13
memberBrian_TheLion28-Mar-19 0:13 
GeneralRe: Global variables are not supported in C# Pin
Richard MacCutchan28-Mar-19 1:43
protectorRichard MacCutchan28-Mar-19 1:43 
GeneralRe: Global variables are not supported in C# Pin
Brian_TheLion28-Mar-19 2:02
memberBrian_TheLion28-Mar-19 2:02 
GeneralRe: Global variables are not supported in C# Pin
jschell13-Apr-19 6:42
memberjschell13-Apr-19 6:42 
GeneralRe: Global variables are not supported in C# Pin
Dr.Walt Fair, PE5-May-19 7:54
professionalDr.Walt Fair, PE5-May-19 7:54 
AnswerRe: Global variables are not supported in C# Pin
Maciej Los27-Mar-19 23:00
protectorMaciej Los27-Mar-19 23:00 
GeneralRe: Global variables are not supported in C# Pin
Brian_TheLion27-Mar-19 23:35
memberBrian_TheLion27-Mar-19 23:35 
AnswerRe: Global variables are not supported in C# Pin
Dr.Walt Fair, PE5-May-19 7:50
professionalDr.Walt Fair, PE5-May-19 7:50 
QuestionHome automation using iot Pin
Member 1417643119-Mar-19 1:49
memberMember 1417643119-Mar-19 1:49 
AnswerRe: Home automation using iot Pin
OriginalGriff19-Mar-19 1:51
protectorOriginalGriff19-Mar-19 1:51 
AnswerRe: Home automation using iot Pin
jschell23-Mar-19 5:48
memberjschell23-Mar-19 5:48 
QuestionStore all words in a Trie into a list Pin
Member 1418712518-Mar-19 13:55
memberMember 1418712518-Mar-19 13:55 
GeneralRe: Store all words in a Trie into a list Pin
Richard MacCutchan18-Mar-19 22:55
protectorRichard MacCutchan18-Mar-19 22:55 
QuestionGraph theory algortithm Pin
Member 141708224-Mar-19 8:33
memberMember 141708224-Mar-19 8:33 
QuestionJava 8 or 10 for Windows 8.1 Pin
Brian_TheLion2-Mar-19 11:45
memberBrian_TheLion2-Mar-19 11:45 
AnswerRe: Java 8 or 10 for Windows 8.1 Pin
Richard MacCutchan3-Mar-19 2:36
protectorRichard MacCutchan3-Mar-19 2:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.