Python Forum
Building a patterned grid from a dictionary...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Building a patterned grid from a dictionary...
#1
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)
Reply


Messages In This Thread
Building a patterned grid from a dictionary... - by xepicxmonkeyx - Oct-01-2016, 02:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Converting a patterned string or text into excel table soup1987 1 2,178 Oct-03-2019, 01:37 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020