This site requires JavaScript, please enable it in your browser!
Greenfoot back
Game/maniac
Game/maniac wrote ...

2013/5/28

User info question

Game/maniac Game/maniac

2013/5/28

#
can user info store integer arrays?
I'm not the expert on UserInfo, but I'm pretty sure that's a no. You're allowed a specific number of ints and Strings, but you can only store ints and Strings, not arrays.
danpost danpost

2013/5/28

#
It can store 10 integers; plus one, if you include the 'score' field. What is the value range for the integers in your array and how many elements will there be?
Game/maniac Game/maniac

2013/5/28

#
360000 elements in the array
Game/maniac Game/maniac

2013/5/28

#
could I store an integer array like this in a file. If so how would I do that
Game/maniac Game/maniac

2013/5/28

#
And how could I read the array
davmac davmac

2013/5/28

#
It's not clear which parts you need help with. Here's an I/O tutorial which might get started: http://www.tutorialspoint.com/java/java_files_io.htm Try to ask more specific questions if you need further help.
davmac davmac

2013/5/28

#
Also, be aware that your scenario can't write to files if it's running here on the greenfoot.org website.
Game/maniac Game/maniac

2013/5/28

#
I know I just thought it would be good to be able to save somehow in my new minecraft game
davmac davmac

2013/5/28

#
Ok, so read the tutorial linked above and ask specific questions if you need more help.
You need to login to post a reply.