Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing many booleans

 
john johns
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings,

I'm creating a simple question/answer app with maybe 200+ problems. In this app, I generate a random number to load the question/answer. I want to be able to ensure that when they load up the app again, the same question will not pop up. I know I can store/recall a bunch of individual booleans using sharedpreference to say if it's been used or not; however, I was wondering if there's a more efficient way to do this. If anyone could point me in the right direction, that would be great.

Thanks a lot.

*Edit: I'm thinking too hard. I don't even need to random it. I can just store an int to keep track of what problems they are on. I would still like to know if there's a more efficient way though.
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may find BitSet useful.
 
john johns
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for the reply. I'll take a look at it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic