Skip to content

Instantly share code, notes, and snippets.

@uwezi
Created March 19, 2023 12:45
Show Gist options
  • Save uwezi/3e9b7e0a71fed37ad1059a6f93e6b76d to your computer and use it in GitHub Desktop.
Save uwezi/3e9b7e0a71fed37ad1059a6f93e6b76d to your computer and use it in GitHub Desktop.
[Multiplication table] Create a multiplication table in a loop. #manim #loop #latex #mathtable
from manim import *
class multiplication(Scene):
def construct(self):
for a in [1,2,3]:
theTable = []
for b in range(10):
theTable.append([a, r"\times", b+1, r"=", a*(b+1)])
texTable = MathTable(theTable,include_outer_lines=False).scale(0.6).to_edge(UP)
texTable.remove(*texTable.get_vertical_lines())
texTable.remove(*texTable.get_horizontal_lines())
self.play(Write(texTable))
self.wait(5)
self.remove(texTable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment