Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions visma/discreteMaths/combinatorics.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def factorial(tokens):
tokens, _, _, _, _ = simplify(tokens)
animation = []
comments = []
result = []

if (isinstance(tokens[0], Constant) & len(tokens) == 1):
value = int(tokens[0].calculate())
if value == 0:
Expand All @@ -40,9 +42,11 @@ def factorial(tokens):
comments += [['Expanding the factorial as']]
animation += [resultTokens]
result, _, _, _, _ = simplify(resultTokens)
token_string = tokensToString(result)
comments += [['Hence result: ']]
animation += [tokenizer('f = ' + token_string)]

token_string = tokensToString(result)
comments += [['Hence result: ']]
animation += [tokenizer('f = ' + token_string)]

return result, [], token_string, animation, comments


Expand Down
1 change: 1 addition & 0 deletions visma/gui/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def initUI(self):

hbox.addWidget(splitter1)
self.setLayout(hbox)
self.textChangeTrigger()

self.logBox.append(logger.info('UI Initialised...'))

Expand Down