Sudoku/puzzles possible

beaudoin_nbeaudoin_n Member Posts: 184
edited November -1 in Working with GS (Mac)
Hi,

How would someone go about this ?
I am thinking of having the grid as objects (ie pos1,pos2,pos3,pos4)... or one object reused...
Then having target values for each position

having some code to fill in the blanks

And a button to launch validation... but i didn't see anywhere where i can compare values..
ie if text.pos1 = targetvaluepos1 then win game.

Any thoughts

Comments

  • beaudoin_nbeaudoin_n Member Posts: 184
    No thoughts ?
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    a sudoku game should be pretty easy as long as you have defined positions, like you said: pos1, pos2, pos3, pos4.

    like this:

    pos1 pos2 pos3
    pos4 pos5 pos6
    pos7 pos8 pos9

    allow users to put in any value

    in your validation rules have more attributes like row1 row2 row3 grid1

    row1 = pos1 + pos2 + pos3
    row2 = pos4 + pos5 + pos6

    grid1 = pos1 + pos2 ...+ pos6

    when you validate, just make sure row1 is equal to a value, same with grid1.

    Might not be the best way of doing things, but it should get you started.
  • beaudoin_nbeaudoin_n Member Posts: 184
    How does the validation button get to have rules that depend on the other objects ?
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    all the other objects do is assign values to the global attributes you need to create. then when you validate you just add those up and see if it fits, if it doesn't, they need to try again.
  • beaudoin_nbeaudoin_n Member Posts: 184
    Since there is no keyboard (yet) what would be the best way to let the users choose the numbers ?

    I am still trying to figure out how to have some interactions between objects..... like if i set up some kind of keyboard, how do i then assign the value to the grid.

    Maybe i am asking a stupid question :(
  • gregr209gregr209 Member Posts: 441
    I would just list the numbers 0-9 down the screen (doing them in something like photoshop) and then make them into buttons that would transfer the number pushed to the square.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    yea, what gregr209 said would work, you could also have the users click on the space to change numbers, it could automatically loop though 0-9
  • beaudoin_nbeaudoin_n Member Posts: 184
    Thanks for the suggestion...
    I opted for the touching and changing the numbers.. easier than the keyboard i think...

    Now if i want to make several grids and keep the best time for each grid
    I guess i have to have a game attribute for each level time.

    So far not a problem, but how can i assign them dynamically, ie if i am on grid 1 and i validate (save time to grid1besttime) but if i am on grid 23 i need to save to grid23besttime.
    what's the best way of doing this without having to hardcode all over the place ?

    Any limits on the number of scenes ?
    I am thinking of having several grids maybe hundreds.. will i go over any limits ?

    How about size < 10Megs ..

    Thanks
Sign In or Register to comment.