STEAM GROUP
Programmers [&p]
STEAM GROUP
Programmers [&p]
9
IN-GAME
51
ONLINE
Founded
3 September, 2008
Odosu 25 Oct, 2015 @ 5:47pm
Free cookie if you can solve this simple programming problem. [Java, c#, or python knowlege required]
Inventory = new ArrayList<String>();
/**@param Item
* adds a String to an ArrayList of strings called in the constructor for the class.
*/
public void addItem(String I){

}



################################################################################
Its pretty easy, good luck everyone, message me if you get it right.
Last edited by Odosu; 25 Oct, 2015 @ 5:49pm
< >
Showing 1-2 of 2 comments
Vorst 20 Apr, 2016 @ 5:12am 
inventory = new ArrayList<String>(); /** * @param Item * adds a String to an ArrayList of strings called in the constructor for the class. */ public void addItem(String s) { inventory.add(s); }
You can simply just call
inventory.add();
anywhere instead of dedicating a method to it. :)
Last edited by Vorst; 20 Apr, 2016 @ 5:12am
Odosu 20 Apr, 2016 @ 2:31pm 
Yay you did it!
Here is your cookie http://vignette2.wikia.nocookie.net/recipes/images/a/ab/Chocolate_chip_cookie.jpg/revision/latest?cb=20131219183907


oh and the reason why its a method is because its from my game that i hardcoded like the old texed based games made basicaly from notepad
Last edited by Odosu; 20 Apr, 2016 @ 2:32pm
< >
Showing 1-2 of 2 comments
Per page: 1530 50

Date Posted: 25 Oct, 2015 @ 5:47pm
Posts: 2