This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Agar | |
# Made for Pythonista on iPad | |
from scene import * | |
from random import randint | |
from math import pi, pow | |
BACKGROUND_COLOR = Color(0, 0, 0) # The color of the background. | |
BLOB_COLOR = Color(0.5, 0.5, 1, 0.5) # The least background-like blob color possible. | |
TEXT_COLOR = Color(0.8, 0.8, 1, 0.8) # The color of the mass counter text. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Enum | |
def self.parse?(string : String) : self? | |
parts = string.split("|") | |
output = new(0) | |
parts.each do |part| | |
p = previous_def(part.strip) | |
return nil if p.nil? | |
output |= p | |
end | |
output |