瀏覽代碼

Add What If? 11 example

David Peter 2 年之前
父節點
當前提交
418b524723
共有 1 個文件被更改,包括 17 次插入0 次删除
  1. 17 0
      examples/what_if_11.nbt

+ 17 - 0
examples/what_if_11.nbt

@@ -0,0 +1,17 @@
+# Droppings
+#
+# If you went outside and lay down on your back with your mouth open, how long
+# would you have to wait until a bird pooped in it?
+#
+# https://what-if.xkcd.com/11/
+
+@aliases(birds)
+unit bird
+unit mouth
+unit poop
+
+let earth_radius = 6371 km
+
+let frequency = (300 billion birds / 4 pi earth_radius^2) × (1 poop / bird / hour) × (16 hours / day) × (1 mouth / poop) × (15 cm^2 / mouth)
+let period = 1 / frequency
+print(period -> years)