diff options
author | Walther Neuper <wneuper@localhost.(none)> | 2010-05-13 18:32:43 (GMT) |
---|---|---|
committer | Walther Neuper <wneuper@localhost.(none)> | 2010-05-13 18:32:43 (GMT) |
commit | 556dde472ef84c8816ce78e2bdc23a43fcc60a75 (patch) | |
tree | 372424440ad02c9e4212225745f62d5d2b523009 /ReckonPrimer.activity | |
parent | 089a18d571ebfdcfd1d22c2273191ba8afec7da9 (diff) |
all old exercises work: calc+settings
Diffstat (limited to 'ReckonPrimer.activity')
-rw-r--r-- | ReckonPrimer.activity/exercises/expassten.py | 8 | ||||
-rw-r--r-- | ReckonPrimer.activity/functions.py | 27 |
2 files changed, 25 insertions, 10 deletions
diff --git a/ReckonPrimer.activity/exercises/expassten.py b/ReckonPrimer.activity/exercises/expassten.py index 6bac2f3..f5a9b8f 100644 --- a/ReckonPrimer.activity/exercises/expassten.py +++ b/ReckonPrimer.activity/exercises/expassten.py @@ -259,10 +259,10 @@ class ExPassTen(Exercise): self._display.settings_table.attach(self.label3, 2, 3, 11, 12 ) self.label3.show() - self.label6 = gtk.Label(self._display._sett['MAX']) - self.label6.modify_font(pango.FontDescription("sans 12")) - self._display.settings_table.attach(self.label6, 5, 6, 1, 2 ) - self.label6.show() +# self.label6 = gtk.Label(self._display._sett['MAX']) +# self.label6.modify_font(pango.FontDescription("sans 12")) +# self._display.settings_table.attach(self.label6, 5, 6, 1, 2 ) +# self.label6.show() #self.label7 = gtk.Label(self._display._sess._gen.count((self._display._key, self._display._sett))) #self.label7.modify_font(pango.FontDescription("sans 12")) diff --git a/ReckonPrimer.activity/functions.py b/ReckonPrimer.activity/functions.py index bf51c3b..4743b16 100644 --- a/ReckonPrimer.activity/functions.py +++ b/ReckonPrimer.activity/functions.py @@ -225,10 +225,13 @@ def make_input(coll_calc, linepos): def make_input_remainder(strs, res, rem):
- """make the 2 lines for input result and remainder with ':' and 'in'"""
- #print('in make_input_remainder: len(strs)=', len(strs))
- #print('in make_input_remainder: strs=', strs)
- #print('in make_input_remainder: res=', res, ', rem=', rem)
+ """make the line for input result and remainder with ':' and 'in'.
+ res: , rem:
+ returns:
+ """
+ print('in functions.make_input_remainder: len(strs)=', len(strs))
+ print('in functions.make_input_remainder: strs=', strs)
+ print('in functions.make_input_remainder: res=', res, ', rem=', rem)
_strs = copy.deepcopy(strs)
if len(_strs) == 13: # 9 : 2 = 4|1
_line1 = copy.deepcopy(_strs)
@@ -236,10 +239,11 @@ def make_input_remainder(strs, res, rem): _line2 = copy.deepcopy(_strs)
_strs[11] = rem[0]
_line3 = copy.deepcopy(_strs)
- #print('in make_input_remainder: line1,2,3=', _line1, _line2, _line3)
+ print('in make_input_remainder: line1,2,3=', _line1, _line2, _line3)
_ins = [(0, 9, res[0], "".join(_line1), "".join(_line2), _line2),\
(0, 11, rem[0], "".join(_line2), "".join(_line3), _line3)]
elif len(_strs) == 14: # 17 : 2 = 8|1
+ print('in functions.make_input_remainder: len(_strs) == 14')
_line1 = copy.deepcopy(_strs)
_strs[10] = res[0]
_line2 = copy.deepcopy(_strs)
@@ -248,8 +252,10 @@ def make_input_remainder(strs, res, rem): _ins = [(0, 10, res[0], "".join(_line1), "".join(_line2), _line2),\
(0, 12, rem[0], "".join(_line2), "".join(_line3), _line3)]
elif len(_strs) == 15: # 20 : 2 = 10|0
+ print('in functions.make_input_remainder: len(_strs) == 15')
_line1 = copy.deepcopy(_strs)
_strs[10] = res[0]
+ print('', _strs[10])
_line2 = copy.deepcopy(_strs)
_strs[11] = res[1]
_line3 = copy.deepcopy(_strs)
@@ -323,6 +329,7 @@ def flatten(ls): #print(flatten([['2'], 'in', ['2', '0'], '=', ['1', '0'], '|', ['0']]))
#['2', 'in', '2', '0', '=', '1', '0', '|', '0']
+
def ins_ord(ls, n):
"""Insert n into the ordered list ls. Beware of creating doubles. """
pos = 0
@@ -352,4 +359,12 @@ def ins_ord(ls, n): #print("result=",xx)
#xx = ins_ord([2,4,8], 4)
-#print("result=",xx)
+#print("result=",xx) + + +#if (len(xxx) < 2): +# print('xxx < 2') +#if (len(xxx) > 2): +# print('xxx > 2') +#else: +# print('xxx = 2') |