Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Text Based Game Board

 
william rapa
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to make a text based Game board running out of my console. Whats a good way to make this game board and make it able to save pieces on it. I have a few ideas but I am unsure about it. I was thinking of a board made form a double array but I am unsure how to save my pieces into it.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Patrick and welcome to the JavaRanch.

I would not use an array but create a class Board. Internally you can use an array of course.
Here you can read all about arrays.
 
william rapa
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any tips on what would be a good alternative?
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would stick with arrays. They iterate easily and can have a square shape matching the board.
 
william rapa
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay ill give it a try thank you.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome and good luck.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic