mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
40 lines
891 B
Python
40 lines
891 B
Python
![]() |
|
||
|
from big_ol_pile_of_manim_imports import *
|
||
|
from active_projects.eop.reusables import *
|
||
|
|
||
|
class JustFlipping(Scene):
|
||
|
|
||
|
def construct(self):
|
||
|
|
||
|
randy = CoinFlippingPiCreature().shift(2 * DOWN)
|
||
|
self.add(randy)
|
||
|
|
||
|
self.wait(2)
|
||
|
|
||
|
for i in range(10):
|
||
|
self.wait()
|
||
|
self.play(FlipCoin(randy))
|
||
|
|
||
|
|
||
|
|
||
|
class JustFlippingWithResults(Scene):
|
||
|
|
||
|
def construct(self):
|
||
|
|
||
|
randy = CoinFlippingPiCreature().shift(2 * DOWN)
|
||
|
self.add(randy)
|
||
|
|
||
|
self.wait(2)
|
||
|
|
||
|
for i in range(10):
|
||
|
self.wait()
|
||
|
self.play(FlipCoin(randy))
|
||
|
result = random.choice(["H", "T"])
|
||
|
if result == "H":
|
||
|
coin = UprightHeads().scale(3)
|
||
|
else:
|
||
|
coin = UprightTails().scale(3)
|
||
|
coin.move_to(2 * UP + 2.5 * LEFT + i * 0.6 * RIGHT)
|
||
|
self.play(FadeIn(coin))
|
||
|
|