Oct-01-2016, 02:35 AM
I'm making a peg solitaire type grid, with the peg holes being displayed as an 'O', and the corners where the pegs can't go (but must still have displayed something for the grid displayed to look like a cross) be displayed as an "X".
xx000xx
xx000xx
0000000
0000000
0000000
xx000xx
xx000xx
What I am trying to do is set up a class which will take lists of groups of three inputs like follows:
# X : Y : Boolean
1 : 1 : False
1 : 2 : False
1 : 3 : True
1 : 4 : True
1 : 5 : True
1 : 6 : False
1 : 7 : False
2 : 1 : False
2 : 2 : False
2 : 3 : True
2 : 4 : True
2 : 5 : True
2 : 6 : False
2 : 7 : False
So on, and so on....
This will then be read through and printed out, with False co-ordinates displayed as an X, and True Co-ordinate as an O. But I need to do this in batch, I can't just assign 49 variables calling the readGrid() class. So is there any way of cycling through large three input dictionary type variables? Or any ideas on how I might go about this. (I'm quite tired so I'm having a tough time think by myself XD)
xx000xx
xx000xx
0000000
0000000
0000000
xx000xx
xx000xx
What I am trying to do is set up a class which will take lists of groups of three inputs like follows:
# X : Y : Boolean
1 : 1 : False
1 : 2 : False
1 : 3 : True
1 : 4 : True
1 : 5 : True
1 : 6 : False
1 : 7 : False
2 : 1 : False
2 : 2 : False
2 : 3 : True
2 : 4 : True
2 : 5 : True
2 : 6 : False
2 : 7 : False
So on, and so on....
This will then be read through and printed out, with False co-ordinates displayed as an X, and True Co-ordinate as an O. But I need to do this in batch, I can't just assign 49 variables calling the readGrid() class. So is there any way of cycling through large three input dictionary type variables? Or any ideas on how I might go about this. (I'm quite tired so I'm having a tough time think by myself XD)