Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://kodomo.cmm.msu.su/trac/cca/changeset/53
Äàòà èçìåíåíèÿ: Unknown
Äàòà èíäåêñèðîâàíèÿ: Sun Apr 10 00:53:50 2016
Êîäèðîâêà: IBM-866
Changeset 53:be7479f995a8 òÀÓ Cyclyc Cell Automata

Changeset 53:be7479f995a8


Ignore:
Timestamp:
12/06/10 17:50:23 (5 years ago)
Author:
is_rusinov
Branch:
default
Message:

some corrections in next_step and mouse handlers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Interface.py

    r52 r53 ˆà
    3636        ˆà
    3737        def next_step(self):ˆà
    38ˆà                self.draw_step()ˆà
    ˆà38                self.draw_cell(automata.next_step())ˆà
    3939        ˆà
    4040        def save_file(self):ˆà
    òÀæ òÀæ ˆà
    118118                index = (automata.symbols[automata.field[row][column]] + 1) % len(automata.states)ˆà
    119119                automata.field[row][column] = automata.states[index].symbolˆà
    120ˆà                self.draw_cell(tuple([column, row]))ˆà
    ˆà120                self.draw_cell([(row, column)])ˆà
    121121        ˆà
    122122        def motion1(self, event):# drawerˆà
    òÀæ òÀæ ˆà
    125125                index = (automata.symbols[automata.field[row][column]] + 1) % len(automata.states)ˆà
    126126                automata.field[row][column] = automata.states[index].symbolˆà
    127ˆà                self.draw_cell(tuple([column, row]))ˆà
    ˆà127                self.draw_cell([(row, column)])ˆà
    128128        ˆà
    129129        def press3(self, event):# drawerˆà
    òÀæ òÀæ ˆà
    132132                index = (automata.symbols[automata.field[row][column]] + len(automata.states) - 1) % len(automata.states)ˆà
    133133                automata.field[row][column] = automata.states[index].symbolˆà
    134ˆà                self.draw_cell(tuple([column, row]))ˆà
    ˆà134                self.draw_cell([(row, column)])ˆà
    135135        ˆà
    136136        def motion3(self, event):# drawerˆà
    òÀæ òÀæ ˆà
    139139                index = (automata.symbols[automata.field[row][column]] + len(automata.states) - 1) % len(automata.states)ˆà
    140140                automata.field[row][column] = automata.states[index].symbolˆà
    141ˆà                self.draw_cell(tuple([column, row]))ˆà
    ˆà141                self.draw_cell([(row, column)])ˆà
    142142        ˆà
    143143        def press1_key(self, event):# drawerˆà
    òÀæ òÀæ ˆà
    146146                        row = (event.y - self.offset_y * (self.cell_size + self.line_width)) / (self.cell_size + self.line_width)ˆà
    147147                        automata.field[row][column] = automata.states[keys[event.char]].symbolˆà
    148ˆà                        self.draw_cell(tuple([column, row]))ˆà
    ˆà148                        self.draw_cell([(row, column)])ˆà
    149149        ˆà
    150150        def motion1_key(self, event):# drawerˆà
    òÀæ òÀæ ˆà
    153153                        row = (event.y - self.offset_y * (self.cell_size + self.line_width)) / (self.cell_size + self.line_width)ˆà
    154154                        automata.field[row][column] = automata.states[keys[event.char]].symbolˆà
    155ˆà                        self.draw_cell(tuple([column, row]))ˆà
    ˆà155                        self.draw_cell([(row, column)])ˆà
    156156        ˆà
    157157        def press1_ctrl(self, event):# change_offset (B1+ctrl)ˆà
Note: See TracChangeset for help on using the changeset viewer.