diff options
Diffstat (limited to 'ReckonPrimer.tests/extimesdiv/test_extd_format.py')
-rw-r--r-- | ReckonPrimer.tests/extimesdiv/test_extd_format.py | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/ReckonPrimer.tests/extimesdiv/test_extd_format.py b/ReckonPrimer.tests/extimesdiv/test_extd_format.py new file mode 100644 index 0000000..e19a623 --- /dev/null +++ b/ReckonPrimer.tests/extimesdiv/test_extd_format.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- + +print("====================================_____________________=============") +print("===== ReckonPrimer.tests/extimesdiv/test_extd_format.py =============") + +from extimesdiv import ExTimesDiv + +_sett = {'topic' : 'times_div', #for programmers only + 'title' : 'template extimesdiv', + 'descript': 'multiplication, division and "in" \ + from 2 to 19 and 20 to 190. ', + 'icon' : None, # for quick reference of the exercise + 'calclines' : 1, # no. of lines for calc to be input. + 'MAX' : 100, # maximum of calcs generated; + # TODO: Generate fills up by varying input. + 'MIN' : 10, # minimum of calcs generated 090416WN:UNUSED + '*' : False, # eg. 7 . 2 =_ + '*commute' : False, # commute the operands 2 . 7 = _ + ':' : False, # 14 : 2 = _ + 'in' : True, # 2 in 14 = _ + 'remainder' : True, # : | in ... with remainder + 'vadd' : 0, # 0 or 10, for 1.11 ... 1.19 + 'vmult' : 1, # 1 or 10, for 1.10 ... 1.90 + 'min' : 2, # +: minimum number in right *operand + # -: minimum result + 'max' : 2, # +: maximum number in right *operand + # -: maximum result + 'shuffle_all' : False, # shuffle all calcs + 'shuffle_inner': False, # shuffle only 1st (inner) iteration + 'cut-max' : True # cut set of all calcs down to MAX + } +_ex = ExTimesDiv(None, (_sett, None)) +_ex._generate_calcs() +#_calc = _ex.get_next_calc() +#print("in test_extd_format: _calc=", _calc) +_calc1 = (['2', 'in', '2', '0', '=', '1', '0', '|', '0'], 5) +_calc2 = (['1', '2', 'in', '2', '0', '=', '1', '|', '8'], 5) +print("in test_extd_format@@@@@@@@@@@@@: _calc1=", _calc1) +_form1 = _ex.format(_calc1) +print("in test_extd_format@@@@@@@@@@@@@: _form1=", _form1) +""" +([[' ', '2', ' ', 'in', ' ', '2', '0', ' ', '=', ' ', '_', '_', '|', '_', ' ']], + [(0, 13, '0', ' 2 in 20 = 10|_ ', ' 2 in 20 = 10|0 ', + [' ', '2', ' ', 'in', ' ', '2', '0', ' ', '=', ' ', '1', '0', '|', '0', ' '] + ), + (0, 11, '0', ' 2 in 20 = 1_|_ ', ' 2 in 20 = 10|_ ', [' ', '2', ' ', 'in', ' ', '2', '0', ' ', '=', ' ', '1', '0', '|', '_', ' ']), + (0, 10, '1', ' 2 in 20 = __|_ ', ' 2 in 20 = 1_|_ ', [' ', '2', ' ', 'in', ' ', '2', '0', ' ', '=', ' ', '1', '_', '|', '_', ' '])])) +""" + +print(len(['1','2','3','a',' '])) + +([[] + ] +) + + +print("in test_extd_format@@@@@@@@@@@@@: _calc2=", _calc2) +_ex.format(_calc2) + + + + + + + +[' ','1 ', '2', ' ', 'in', ' ', '2', '0', ' ', '=', ' ', '1', '|', '8', ' '] + + + +[' ','1 ', '2', '0', ' ', 'in', ' ', '2', '0', ' ', '=', ' ', '0', '|', '1','2', '0', ' '] + + |