« first day (4008 days earlier)      last day (839 days later) » 

4:00 AM
it's known to be a little problematic because of memory references internally
 
!!/run 1 2+3/
 
@PyGamer0 1
 
Here's a challenge that shouldn't be too hard:
VyMC: Given an algebraic expression including only +-*/^x for addition, subtraction, multiplication, division, exponentiation and variable x, return a list of the anti-derivative and firstderivative
 
so @f:2|;@f; is a really verbose $?
 
@Nitrodon essentially, yes.
 
4:01 AM
@Nitrodon Just so you know, if there's weird stuff going on, we'll probably blame it on the rewrite, no matter how long it's been an issue
 
@taRadvylfsriksushilani why is it blocked lol
 
11 hours ago, by ta Radvylf srik su shilani
@mathcat My guess? The word fuck in brainfuck
 
@lyxal hint: use ∆ė and ∆i- they may or may not do differentiation and integration
 
lmao
 
or they might be the nth digit of e and/or pi.
 
4:06 AM
@Nitrodon the string overloads exist, they just haven't made it into the documentation even though I'm pretty sure I placed them there once
 
!!/run ₍∆i∆ė - x^2+4
 
@Nitrodon ⟨ x**3/3 + 4*x | `2*x` ⟩
 
Excellent
 
Should I break things by inputting x^x?
 
I don't know if it does break anything
All the algebra stuff is handled by Sympy
 
4:08 AM
Can you actually use that function?
 
Probably
 
via ∆Ė?
 
Yes
 
but then what would x be?
 
There's also other commands for substituting values of x
 
4:12 AM
!!/run `x^x`∆i
 
@Nitrodon Integral(x**x, x)
 
I don't think it has a closed form.
 
As I said, it uses Sympy to do all algebraic stuff, so that's Sympy's best representation
 
I don't know that much Python, and I've never used Sympy.
 
Ah, well Sympy is a symbolic math library
It's well known and widely used within the python community
 
4:15 AM
are yall using Adám's lb?
 
I am
 
I'm using it right now. Apparently some things changed and haven't been updated in the tooltips though.
 
exam proved that i am bad at chemistry
 
@Nitrodon if in doubt, use the keyboard at vyxal.pythonanywhere.com
VyMC: Given a list of strings and positive integers, return only items which are palindromic.
that should be much simpler
 
!!/run 'Ḃ= - [234, 232, "hello", "radar"]
 
4:22 AM
@Nitrodon ⟨ 232 | `radar` ⟩
 
good job
VyMC: Given a non-empty string, return the percentage of each character. E.g. "this is a certified bruh moment" -> [["t", 3/31], ["h", 2/31], ["i", 4/31], ["s", 2/31], [" ", 5/31], ["a", 1/31], ["c", 1/31], ["e", 3/31], ["r", 2/31], ["f", 1/31], ["d", 1/31], ["b", 1/31], ["u", 1/31], ["m", 2/31], ["o", 1/31], ["n", 1/31]]
 
fun fact: i have my math computer exam today
i am confusin my friend with APL glyphs lmao
 
!!/run f:U‡=ṁZ - this is a certified bruh moment
 
@Nitrodon ⟨ ⟨ `t` | 0 ⟩ | ⟨ `h` | 1 ⟩ | ⟨ `i` | 0 ⟩ | ⟨ `s` | 0 ⟩ | ⟨ ` ` | 1 ⟩ | ⟨ `a` | 0 ⟩ | ⟨ `c` | 0 ⟩ | ⟨ `e` | 1 ⟩ | ⟨ `r` | 0 ⟩ | ⟨ `f` | 0 ⟩ | ⟨ `d` | 0 ⟩ | ⟨ `b` | 1 ⟩ | ⟨ `u` | 0 ⟩ | ⟨ `m` | 1 ⟩ | ⟨ `o` | 0 ⟩ | ⟨ `n` | 0 ⟩ ⟩
 
I clearly don't know what I'm doing.
 
4:34 AM
Hint: Ċ will help
also, the documentation for and the multi-element lambdas has been fixed
 
but if I divide that by the length directly, I would probably get [[["t"], 3/31], ...]
 
@Nitrodon which is also where ƛ...; might come in handy
it maps a function to each item in the top of the stack
so for example (and I don't expect you to know exactly what's happening here):
 
(Is my guess as to what would happen correct?)
 
!!/run 40ɾ ƛ₍₃₅kF½*∑∴
 
@lyxal ⟨ 1 | 2 | `Fizz` | 4 | `Buzz` | `Fizz` | 7 | 8 | `Fizz` | `Buzz` | 11 | `Fizz` | 13 | 14 | `FizzBuzz` | 16 | 17 | `Fizz` | 19 | `Buzz` | `Fizz` | 22 | 23 | `Fizz` | `Buzz` | 26 | `Fizz` | 28 | 29 | `FizzBuzz` | 31 | 32 | `Fizz` | 34 | `Buzz` | `Fizz` | 37 | 38 | `Fizz` | `Buzz` ⟩
 
4:38 AM
@Nitrodon pretty much
@VyxalBot obviously it's FizzBuzz, but the point is that it maps ₍₃₅kF½*∑∴ to each item in the range 1...40
!!/run Ċ - this is a certified bruh moment
 
@lyxal ⟨ ⟨ `t` | 3 ⟩ | ⟨ `h` | 2 ⟩ | ⟨ `i` | 4 ⟩ | ⟨ `s` | 2 ⟩ | ⟨ ` ` | 5 ⟩ | ⟨ `a` | 1 ⟩ | ⟨ `c` | 1 ⟩ | ⟨ `e` | 3 ⟩ | ⟨ `r` | 2 ⟩ | ⟨ `f` | 1 ⟩ | ⟨ `d` | 1 ⟩ | ⟨ `b` | 1 ⟩ | ⟨ `u` | 1 ⟩ | ⟨ `m` | 2 ⟩ | ⟨ `o` | 1 ⟩ | ⟨ `n` | 1 ⟩ ⟩
 
yeah, I can see what Ċ does from the documentation.
 
that's what Ċ does
now what if you were to map something over that list returned by Ċ that only touched the tail of each list
it's worth mentioning that ÷ dumps the contents of a list onto the stack
!!/run 1 20r÷W
 
@lyxal ⟨ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 ⟩
 
obviously that doesn't look like it did anything, but the W is to show what the stack would be
 
4:41 AM
I'm just wondering now how to get the 31 from inside the lambda.
 
Have we mentioned how to explicitly take input?
 
by trying to read an empty stack?
 
no
 
That's the only way I know.
 
?
? reads the next input
!!/run ? ? + - 3 4
 
4:42 AM
@lyxal 7
 
and once it runs out of input, it loops around again, just like implicit input
and ¹ can also be used to get the first and second input
 
!!/run Ċƛ÷?L/W - this is a certified bruh moment
 
@Nitrodon ⟨ ⟨ `t` | 3/31 ⟩ | ⟨ `h` | 2/31 ⟩ | ⟨ `i` | 4/31 ⟩ | ⟨ `s` | 2/31 ⟩ | ⟨ ` ` | 5/31 ⟩ | ⟨ `a` | 1/31 ⟩ | ⟨ `c` | 1/31 ⟩ | ⟨ `e` | 3/31 ⟩ | ⟨ `r` | 2/31 ⟩ | ⟨ `f` | 1/31 ⟩ | ⟨ `d` | 1/31 ⟩ | ⟨ `b` | 1/31 ⟩ | ⟨ `u` | 1/31 ⟩ | ⟨ `m` | 2/31 ⟩ | ⟨ `o` | 1/31 ⟩ | ⟨ `n` | 1/31 ⟩ ⟩
 
well done!
VyMC: Given a string, and a regular expression, replace each match with the reverse of that match. E.g. "abaaa4949jfa9304jfs908023", "\d+" -> "abaaa9494jfa4039jfs320809"
 
!!/run ⁽Ṙøṙ - abaaa4949jfa9304jfs908023 \d+
 
4:49 AM
@Nitrodon abaaa9494jfa4039jfs320809
 
good good. It seems you're getting the hang of searching for elements
here's a harder puzzle:
VyMC: Return the string AEIMQUY in 4 bytes
 
oh right, the first input would be top of stack
 
@Nitrodon correct
 
k⊍ is an obvious try, but there's no clear way to get MQ.
 
You're on the right track that there's a k digraph
 
4:52 AM
!!/run `AEIOUY`øc
 
[@Nitrodon: 60189998]
STDERR:
Traceback (most recent call last):
  File "/home/Vyxal/mysite/vyxal/main.py", line 147, in execute_vyxal
    exec(code, locals() | globals())
  File "<string>", line 3, in <module>
  File "/home/Vyxal/mysite/vyxal/elements.py", line 332, in base_255_string_compress
    + to_base(
  File "/home/Vyxal/mysite/vyxal/elements.py", line 3541, in to_base
    maximal_exponent = int(log_mold_multi(lhs, len(rhs), ctx))
  File "/home/Vyxal/mysite/vyxal/elements.py", line 1991, in log_mold_multi
 
i do note that M and Q are both two places off from O
 
base255 string compression only works with lowrcase letters
 
I also do note that.
 
no fucking clue what you can do with that
 
4:53 AM
I'd check what the position of each letter in the alphabet is
see if that gives any clues
it might, it might not
 
1 5 9 13 17 21 25... oh
 
kAyy would probably be DHLPTX though.
 
> probably
!!/run kAyy
 
@UnrelatedString DHLPTX
 
4:57 AM
no chances necessary
 
The only other hint I'll give is that the aim of this puzzle was to highlight a potentially obscure overload
 
Is it documented?
 
It is
 
!!/run kAyy r
 
5:01 AM
[@UnrelatedString: 60190021]
STDERR:
Traceback (most recent call last):
  File "/home/Vyxal/mysite/vyxal/main.py", line 147, in execute_vyxal
    exec(code, locals() | globals())
  File "<string>", line 7, in <module>
  File "/home/Vyxal/mysite/vyxal/elements.py", line 2547, in orderless_range
    return {
  File "/home/Vyxal/mysite/vyxal/elements.py", line 2565, in <lambda>
    (str, str): lambda: int(re.compile(lhs).search(rhs)),
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
 
i see
tried and it seems to error
oh
md5 97b93dc9528f8f07825170e5dfb15cc2
 
@UnrelatedString bingo!
 
@Nitrodon I will say that kA is definitely the first two bytes
 
Why did it error and say my session was invalid?
but it's working now for some reason
 
5:12 AM
@Nitrodon maybe a change was pushed to the server
 
//!run kA4Ḟ
!!/run kA4Ḟ
 
@Nitrodon AEIMQUY
 
@Nitrodon i tried exactly that on the interpreter page and it complained that ints aren't iterable
nice though
 
I didn't know there could be more than one way to do it
 
5:18 AM
VyMC: Given a list of positive integers, sort it in ascending order without using any of sṡµ
 
TIL rabies evolved to cause extreme fear and pain from drinking water, in order to decrease the odds that the victim swallows their saliva (which is how it spreads)
 
!!/info
 
One last thing I forgot to teach is string compression
There's two kinds: dictionary compression and base255 compression
Base255 compression is probably the easiest to explain
 
Oh nice lyxal teachiing vyxal
the next adam lol
 
5:25 AM
Given a string of lower case letters and spaces, it converts it from a custom base 27 to base 10
It then turns that base 10 number into a custom Base255 number
This kind of string is delimited with «
The base255 compressed version of a string can be obtained by using øc
!!/run `hello there`øc
 
@lyxal «⟇%J^∞¶~«
 
!!/run «⟇%J^∞¶~
 
@Nitrodon hello there
 
Sorry about that, copy pasting on mobile is harder than it seems
There's also base255 compression for numbers too:
!!/run 84876294782928 øC
 
@lyxal »OḂẏ¬λ∧»
 
5:29 AM
!!/run »OḂẏ¬λ∧»
 
@lyxal 84876294782928
 
!!/run «⟇ẏ=zd√€∩⌐;↵
 
@null come back lyxakyyz
 
!!/run ⇧ƛ?$i - [3, 1, 4, 1, 5, 9]
 
@Nitrodon ⟨ 1 | 1 | 3 | 4 | 5 | 9 ⟩
 
5:31 AM
@Nitrodon there's a built-in for ƛ?$i
See if you can find it
 
two byte answer get
nice
didn't know the up arrow exist
it's just Nitrodon's answer with the built-in lyxal mentioned
 
I'm still unsure of why ⁽iM didn't work.
 
Correct
 
!!/run «⟇Y//;£ƛṁ8ǎ∆꘍¾Z⟩↲‛⁰PṀ Ṙ¾ṗ¶ǎƛẆƒ□ṫẆȮ]Ḋ&₄hċ^→₄•ꜝ⟑»ǒn~9_Zæ↓ßẏs?→„τ5H~¬pA@→∪&Ġyτ9→ṘZ?tτḣ¤ẏ¹•±λ5R&ɽoτ=£÷Ẏċ•qdʀgw²X_{Þ₌ȯĿṡßnƛ₅¦ßZẊ+ṗL∴
 
@null just a tiny little distraction and question and request and announcement can you all or please dont or will you all cast a lot of downvotes if i write an answer to the recent downvoted tip question at some point
 
5:35 AM
@Nitrodon because mapping is monadic - it only takes a single argument
In this case, it's taking the list of indices, and indexing each indice into itself
 
Wow, y'all're still going
 
@Nitrodon something like Z⁽ƒiM would work
 
I'll have my last exam 20 minutes later
 
That's why İ (index into) exists
So that you can have vectorised indexing in a single byte
 
@null It's a bad question because it's obviously no effort, but good tips actually take effort and you'll probably get upvotes
 
5:38 AM
Just before the next VyMC, I'd like to quickly take a detour back to dictionary compression
Dictionary compression happens within normal backtick strings
 
:60190171
!!/run «∨Q↳eİm
 
@null thank you
 
i hate these predict the output questions, why does the compiler exist?
 
And if you've ever tried to include a non-ascii character in a normal string, you'll notice that something odd happens:
!!/run `what's happening¡¡`
 
@lyxal what's happeningbolivia
 
5:40 AM
The ¡¡ turned into the string bolivia
That's because pairs of non-ascii characters index into a dictionary containing approximately 20k words
 
!!/run `λ⟨'s ż¢
 
@Nitrodon !!/run `code` `flags (- to exclude)` `input line` `input line` ...
 
!!/run `λ⟨'s ż¢
 
@Nitrodon what's happening
 
@VyxalBot what's happening is that each pair is converted from a custom base161 alphabet to base 10
 
5:41 AM
!!/info
 
And the word at that numbered row in the dictionary is inserted where the ascii pair was
@Nitrodon I take it you know that øD returns the dictionary compressed version of a string
 
Either that or I got very lucky.
 
true lol
 
Is there a way to get a non-ASCII character in a string?
 
5:43 AM
There sure is!
 
:60190171
!!/run `€× λ•
 
@null thank you
 
!!/run `wow, it's not decompressing\¡\¡
 
@lyxal wow, it's not decompressing¡¡
 
You simply escape it with a backslash
A final thing to note about dictionary compression is that non-ascii characters on their own act a little differently
 
5:45 AM
see you guys in a hour!
gonna have my final exam now
 
@Niko o/
 
!!/run `\¡\¡λ⋎ of λ× is ⁋⟑!!
 
@Nitrodon ¡¡some of this is compressed!!
 
hope i pass it
 
depends on how much you studied
for example i didnt study for today's computer exam
 
5:46 AM
Watch what happens when I have a non-ascii char on its own:
 
then i am dead for sure
 
!!/run `pairḣ
 
@lyxal pairn't
 
@PyGamer0 i didnt study for my computer exam
& i got A
 
@VyxalBot the string n't isn't in the big dictionary at all
Yet it still appeared somehow
 
5:47 AM
that means: the less you study, the better the result is
 
and øD doesn't compress it
 
@Nitrodon not yet at least. That's something we're getting @hyper-neutrino to work on
What's happened is that it's indexed into a special "short dictionary"
Non-ascii characters on their own get words from a shorter dictionary that can only contain 161 words at the most
 
!!/run `ḣḣḣ`
 
@null ill probably get A+ idk
 
@Nitrodon Thinn't
 
5:49 AM
And because øD doesn't account for it yet, you can find the short dictionary here:
1
A: Tips for Golfing in Vyxal

lyxalUtilise the Short Dictionary Note: This is a 2.6.x+ feature only Newer versions of Vyxal have a neat little feature where 1 character SCCs are indexed into a special "short" dictionary of overlyspecialised "words". Here's a list of all the current entries: \d+ λ -?\d+ ƛ \d+\.\d+ ¬ -?\d+(\.\d*)? ∧...

The term "SCC" stands for "string compression code", and basically means "pair of non-ascii characters"
Anyhow that's the basics of vyxal
 
@PyGamer0 noice
 
@lyxal classes and OOP?
 
@PyGamer0 those haven't been started on yet
Those will probably appear in version 3 later this year
But now that y'all have the vyxal fundamentals, here's the next VyMC
VyMC: Given two strings, return the length of the greatest common suffix
 
Along with (possibly) a package manager
@lyxal There's a 1-byter for that
 
@emanresuA that only solves half the problem and that's also the point
 
5:52 AM
!!/info
 
@emanresuA which is ġ
 
ġL then
 
Is it just me or are the reply buttons invisible?
 
@emanresuA o_o
 
5:54 AM
Then again APL has no package manager and it's got lots more time and resources than us
 
VyMC: Given two numbers n and m, return the result of rolling m n-sided dice (containing numbers 1 to n)
 
@emanresuA pretty sure it does
 
Also, we've been going for almost 6 hours lol
 
!!/run ẋ⁽℅M∑ - 3 6
 
@Nitrodon 13
 
6:00 AM
0
Q: Recursive palindromes

AnttiPA palindrome is a word which is spelled the same backwards and forwards. For example, "racecar" is a palindrome as is "redder". A double palindrome is a palindrome whose halves are also palindromes. For example, "abbabba" is a double palindrome, as the half "abba" is also a palindrome. Similarily, "

 
wait, I have no idea what that does
6 may or may not be a list
 
@Nitrodon iirc it chooses a random number from 1 to m
 
can anynoe tell me how to loop in vyxal
 
VyMC: Without using numbers in your source code, return 10000000000000 in only 3 bytes
Numbers here mean 0-9
 
@lyxal wait, what?
 
6:08 AM
That's 10^13?
 
@Nitrodon correct
@hyper-neutrino making dictionary compression account for the short dictionary
 
It's been assigned to you on github for a while lol
@null either a while loop ({condition|body}) or a for loop ((variable|body))
 
₀, ₄, and ½ look like numbers too, so they're probably out.
 
@Nitrodon no those are fair game
2 mins ago, by lyxal
Numbers here mean 0-9
 
6:10 AM
4 and 1/2 are definitely in that range.
 
I mean only those 9 characters
 
!!/run ₄½↵
 
@Nitrodon 10000000000000
 
Good
VyMC: Return the list [["z", "z"], ["y", "y"], ["x", "x"], ["w", "w"], ["v", "v"], ["u", "u"], ["t", "t"], ["s", "s"], ["r", "r"], ["q", "q"], ["p", "p"], ["o", "o"], ["n", "n"], ["m", "m"], ["l", "l"], ["k", "k"], ["j", "j"], ["i", "i"], ["h", "h"], ["g", "g"], ["f", "f"], ["e", "e"], ["d", "d"], ["c", "c"], ["b", "b"], ["a", "a"]]
 
I'm too tired to look through that list and see if it differs from the output of, kz:Z
 
6:15 AM
It doesn't
And z is :Z
 
^
I'll post two more easy enough VyMCs and we'll take a break
VyMC: Replace all spaces in an input string with asterisks
VyMC: Return if the input is a cube number
Feel free to solve them later
I probably need to restock the list of planned vymcs anyway
 
I answered the latest question, if that counts.
 
6:31 AM
@Nitrodon it does, and good job
You've done well over the last few hours
Very well in fact
 
7:21 AM
finished the test
 
lmao someone in my class said, "I WILL KILL YOU SHUT UP", to another student
@Niko how did it go?
 
hi guys
can i do a minesweeper as a golf challenge
like given coords of the bombs in a grid
the rest is easy (u shld know how this game works lol)
 
7:38 AM
idk might be a dup
^ looks like dupe of one of these
 
@PyGamer0 weird
there is only handwriting
no choice to choose
and it asked my report's content
 
how bout cell evolution as puzzle?
 
Lets just say... our class didn't introduce textbook, but a large part of exam is textbook
 
"Your lab needed to simulate how a particular cell evolves over time in a 2D grid space"
something like that
issit a gd idea?
so like given an integer n (grid size) which is a square
then print out the evolution
 
7:50 AM
"Evolution"?
 
like this
0 0 0 0 0
0 0 0 0 0
0 0 1 0 0
0 0 0 0 0
0 0 0 0 0
the 0 represents dead
1 alive
the 1 will spread around itself
and then it will die
 
So a basic Cellular Automata with the rule, "Alive cells die, new cells are born if they have any neighbors"
 
yes
they *will haev neighours 100% of the time kinda
 
Simple enough, not sure if there's already a challenge for it.
 
not that simple
another rule is
that the number can be >=1
so
0 0 0
0 1 0
0 0 0
 
7:52 AM
No more complex than Implementing the Game of Life
 
becomes
1 1 1
1 2 1
1 1 1
 
I've just been playing a game with circles and now everything looks so square
 
sry
 
0
Q: C++ coding help

lord JWrite a complete C++ program that contains a class called Person. The class should have seven (7) private member variables (attributes) to hold a name, National Registration Identity Card (NRIC) number that has 12-digit numbers, height in centimeter (cm), weight in kilogram (kg), activity level,...

 
the cell wont die until it overcrowds
 
7:53 AM
O h n o
 
so the rules are
The cell evolution follows these rules:
1. '0' indicates no live cell
2. A positive number indicates a live cell. The number indicates its age.
3. A cell will grow from age 1 to 5 in each evolution
4. After age 5, a cell will die at the next evolution (resetting to '0')
5. If a cell has 4 or more neighbours (adjacent and diagonally), it will die due to over-crowding.
6. In each evolution, a live cell will spread to its neighbour (adjacent and diagonally) if there is no live cell there and that neighbour is not overcrowded (surrounded by less than 4 cells)
 
Remember, Complexity does not necessarily make for a good challenge. The best challenges are small in scope, but very interesting non-the-less.
 
u talking to me or the new problem?
and u have to print till all cells are dead
*forgot to mention
grid size<10 to ensure no large outputs
 
(The new problem is just a Homework question)
(Vote to close and move on)
 

« first day (4008 days earlier)      last day (839 days later) »