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‏‏∀‏
  • 14:27 (UTC +10:00)
View GitHub Profile
What are prime numbers?
Prime numbers are the building blocks of the number system. Every whole number can be written as a product of prime numbers. The smallest prime number is 2. The largest prime number is a really huge number called Graham’s number. Humans can’t write down Graham’s number.
A number is called prime if it is only divisible by 1 and itself. The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, and 101.
But what about prime numbers less than 100?
Round 1
Q: https://codegolf.stackexchange.com/a/233192/78850
A: https://codegolf.stackexchange.com/a/233193/78850
Round 2
Q: https://codegolf.stackexchange.com/a/233199/78850
A: https://codegolf.stackexchange.com/a/233203/78850
Round 3
Q: https://codegolf.stackexchange.com/a/233206/78850
For Explicit: pxeger, user
For Implicit: ausername, pygamer0
@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
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"
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))()
- 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
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:
```
// ==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==
⊞θ₂Σ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