Logo Search packages:      
Sourcecode: jack version File versions  Download package

def lifedemo::LifeBoard::__init__ (   self,
  scr,
  char = ord('*') 
)

Return a LifeBoard instance.

scr -- curses screen object to use for display
char -- character used to render live cells (default: '*')

Definition at line 37 of file lifedemo.py.

00037                                           :
      """Return a LifeBoard instance.

      scr -- curses screen object to use for display
      char -- character used to render live cells (default: '*')

      """
      self.state={} ; self.scr=scr
      N, M = self.scr.getmaxyx()
      self.M, self.N = M-2, N-2-1
      self.char = char
      self.scr.clear()  

      # Draw a border around the board
      border_line='+'+(self.M*'-')+'+'
      self.scr.addstr(0, 0, border_line)
      self.scr.addstr(self.N+1,0, border_line)
      for y in range(0, self.N): 
          self.scr.addstr(1+y, 0, '|') 
          self.scr.addstr(1+y, self.M+1, '|')
      self.scr.refresh()
    def set(self, y, x): 


Generated by  Doxygen 1.6.0   Back to index