www.webdeveloper.com
Results 1 to 8 of 8

Thread: Nine Mens Morris layer propeties query

  1. #1
    Join Date
    Dec 2012
    Posts
    4

    Nine Mens Morris layer propeties query

    I have started using Java very recently, and have been assigned to make a program for the board game, nine mens morris. This seems to be extremely outside of my skill level, so apologies if my solution seems like a strange way to achieve what Im trying. Basically, I have set up 24 layers, one for each space on the gameboard where a piece can be placed. I had planned to set up properties "black", "white" and "blank". The idea was to make it possible to set the layers as "black" or "white" on click, dependent on whos turn it is, with the original state being "blank". Then I intended to use an "If" statement to set the piece placed on the gameboard dependent on the state of the layer. Would anyone be able to tell me how I would be able to set up such properties and assign them to a layer when the layer is clicked on?

  2. #2
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,266
    First of all use you Java or Javascript ?

    Then effectively three values are enough to represent empty place (0) and the players or there pieces (1 or 2) on the game board witch can be symbolized by a 24 length string.

    It's perhaps interesting to fiind a representation which respects the possible rotations and symmetries...

    Perhaps could you distinguish the three square with three 8 length string like var board='00000100 00222122 00111002'; for the position on this wikipedia page ?

  3. #3
    Join Date
    Dec 2012
    Posts
    4
    I'm using javascript on Expression Web. This seems like a good solution, but I am basically completely new to java, I wouldn't know how to implement this.

  4. #4
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,266
    Javascript is not Java ! See this page to learn Java...

  5. #5
    Join Date
    Dec 2012
    Posts
    4
    Apologies, like I said Im completely new to this.

  6. #6
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,266
    This game maybe a little complicated for a first test. Tic-tac-toe seems more easily accessible...

  7. #7
    Join Date
    Dec 2012
    Posts
    4
    I think you may be right. It will reduce the amount of marks I can achieve in my assignment, but I suppose a functional, simpler game will be worth more than a complicated broken one anyway. Thanks for the help!

  8. #8
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,266
    You gave me one idea. Here is an essay which is made to work on a mobile ...
    But I am not satisfied with the question mark. I do not know how to manage an touch error ... etc.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles