I made a 🐍Snake AI 💻
[ currently broken :D ]
I made Snake. You can control it using WASD, or the arrow keys. Eat the red apples, and don't crash into the walls or yourself!
When you press space, it uh... helps you out a little :)
@DynamicSquid There is no computer science class.
- Eh, I don't mean strictly rustian. You could probably make it your own, I'm just saying it'd be neat to have a unique memory management scheme.
- Well, I'm not sure. I mean, the functions
int()exist in Python, so why can't the types themselves exist as entities? (Or, maybe each type is a function, and when called that function casts the argument to its type. So basically like Python's
strfunctions, but the function itself is used as the type it casts to.)
A lang with both the second and third ideas could be cool:
int # => the "int" type, which is actually a function int("32") # => calling the int function, which casts "32" to an int class MyType: # a demo type pass int(MyType()) # oh no, there is no dispatch for type `MyType` in the int function! def int(x: MyType): # adding a dispatch option print("Hooray!") int(MyType()) # => "Hooray!"