Skip to content

Instantly share code, notes, and snippets.

View lyxal's full-sized avatar
🍔
It's a regional dialect

lyxal lyxal

🍔
It's a regional dialect
  • ‏ɹ‏‏ǝ‏‏p‏‏u‏‏n ‏u‏ʍ‏‏‏o‏‏p‏ ‏p‏‏u‏‏ɐ‏‏l ‏ǝ‏‏‏ɥ‏‏‏ʇ‏ • ‏ɐ‏‏ᴉ‏‏l‏‏ɐ‏‏ɹ‏‏ʇ‏‏s‏‏n‏‏∀‏
  • 20:02 (UTC +10:00)
View GitHub Profile
["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "twentyone", "twentytwo", "twentythree", "twentyfour", "twentyfive", "twentysix", "twentyseven", "twentyeight", "twentynine", "thirty", "thirtyone", "thirtytwo", "thirtythree", "thirtyfour", "thirtyfive", "thirtysix", "thirtyseven", "thirtyeight", "thirtynine", "forty", "fortyone", "fortytwo", "fortythree", "fortyfour", "fortyfive", "fortysix", "fortyseven", "fortyeight", "fortynine", "fifty", "fiftyone", "fiftytwo", "fiftythree", "fiftyfour", "fiftyfive", "fiftysix", "fiftyseven", "fiftyeight", "fiftynine", "sixty", "sixtyone", "sixtytwo", "sixtythree", "sixtyfour", "sixtyfive", "sixtysix", "sixtyseven", "sixtyeight", "sixtynine", "seventy", "seventyone", "seventytwo", "seventythree", "seventyfour", "seventyfive", "seventysix", "seventyseven", "seventyeight", "seventynine", "eighty", "eightyone", "eightytwo", "
Day 15: A sudden storm hits and the house where the party is being held needs to be secured (challenge [to be better worded]: determine how much weight is needed so that it doesn't get blown over or something)
Day 16: As a result of said storm, your party decides to help those who were impacted by giving care packages (challenge: sort items into boxes)
Day 17 and 18: Taking a break from the "hard work" (I'll write these... it's a surprise)
Day 19: Everyone calls their Ubers to go home (challenge: uber driver's perspective [kinda like day 5] ... don't know what exactly)
Day 20: You as the party host almost forgot to give everyone their presents (I'll write this one too)
Day 21: Turns out Day 15's storm kinda damaged the homes of your party guests and they now need to stay until reperations are done (challenge: socially distance the beds)
Day 22: <I forgot what is was going to be xD>
Day 23: (I'll write this one. Another surprise)
===================
| Learning Jelly |
===================
Programs are made of links. Links are made of chains. Chains are made of atoms. Atoms have a fixed arity.
Each link's chains are evaluated according to a set of predefined "rules".
Links can be niladic (called with 0 arguments), monadic (called with 1 argument) or dyadic (called with 2 arguments)
Nilads have arity 0, monads have arity 1 and dyads have arity 2
⊞θ₂ΣXθ²F =+«←←←ι←G↑←↓⊟θ#
⊞θ₂ # Create a template square with size (a^2)
ΣXθ² # Repeat that code but with the second input
F =+ # Push the 3 character string " =+"
« # Reverse it and insert the characters in between the template squares
←←← # Compute sqrt(a^2 + b^2) [3 byte function]
ι← # Use the code to create the template square and generate one based on the prior result
G↑← # Join everything together into a list and make it into a template
⊟θ# # Substitute # into the template and output
// ==UserScript==
// @name Lyxal's first and probably only userscript
// @namespace http://tampermonkey.net/
// @version 0.1.69.420
// @description <s>try to</s> take over the world!
// @author Lyxal
// @match https://codegolf.stackexchange.com/
// @grant none
// ==/UserScript==
So you want to contribute to Vyxal, hey? Well, that's very poggers of you. Just make sure you follow the suggestion process outlined here so that your ideas can be handled in an organised way.
## Bug Fixes
Bug fixes are very much welcome - they help increase the stability of Vyxal. There's three ways to bring bugs to our attention: github issues, chat requests and pull requests.
### Github Issues
Github issues can be raised [here](https://github.com/Lyxal/Vyxal/issues). If you decide to use this option, use the following template:
```
- Matrix multiplication - Ṁ<[any],[any]>
- Dot product
- Matrix determinant
- Inverse -
- Cartesian power - p
- Cartesian product with self
- Transpose matrix - Ṫ<[any]>
- n x n grid of spaces
- python string methods
capitalize
def function_name(lhs, rhs):
# Only change the parameter names if absolutely neccesary
ts = VY_type(lhs, rhs)
return {
(number, number): lambda: stuff_with_lhs_and_rhs,
(number, str): lambda: more_stuff_with_lhs_and_rhs,
(str, number): lambda: even_more_stuff_with_lhs_and_rhs,
(str, str): lambda: double_string_overload_idk,
(any_other, type_overload_combination): lambda: whatever
}.get(ts, lambda: vectorise(function_name, lhs, rhs))()
import string
NAME = "CONSTANT_TOKEN_NAME"
VALUE = "CONSTANT_TOKEN_VALUE"
IF_STMT = "STRUCTURE_IF"
FOR_STMT = "STRUCTURE_FOR"
WHILE_STMT = "STRUCTURE_WHILE"
FUNCTION_STMT = "STRUCTURE_FUNCTION"
LAMBDA_STMT = "STRUCTURE_LAMBDA"
@lyxal
lyxal / elements.py
Created August 3, 2021 12:37
Testing the implicits library (works well btw)
from implicits import implicits
@implicits("ctx")
def pop(stack, n=1, *, ctx):
ret = [stack.pop() for i in range(n)]
if ctx.reverse_arguments: ret = ret[::-1]
return ret