The Community Ads will close in a week. That includes all new ads, edits and votes, so make sure you're happy with the current ads and your votes before then.
4
(around a week, I figured I'd go earlier rather than later)
Also note that the Codidact ad will not be shown, per the note from the CM team.
This is my first code golf, so here goes.
The challenge is simple: Read the first 3 letters from a system input¹ and convert them to numbers (A-1, B-2, C-3...Z-26)². Print each of those numbers in the order the letters were inputted in, each on a new line and then the sum of all 3 numbers, on its...
@user Well, I have a BS in CS--and I've gotta say your studies of BS are sorely lacking if you haven't experienced the ridiculous pulp-fiction romp that is A Princess of Mars. ;)
@RedwolfPrograms I've never met a scorpion and I never hope to. o_o
trying to think of a shitty reply actually got me genuinely thinking about a language that mostly works like stack-based but popping is replaced with moving the pointer left and pushing is replaced with growing the tape from the middle and then you fuck around with intermediate results by grabbing them from the right of the tape instead of duplicating them on the spot which sounds absolutely terrible but not that terrible
Yeah, I think tape-based languages (to be at all high-level) need to be able to insert and delete cells in the middle of the tape. I'm not sure if that's technically still a tape, but if not, I don't know what else it would be.
@UnrelatedString Wait, I remember... I was definitely considering something like this for a golflang a couple years ago. Doesn't it basically turn out to be stack-based with a second stack, like Brain-Flak?
i mean it's hard to think of first-class functions in a golfing context in the first place since unless you've got some husk stuff going on (where there's no Concrete instance for functions iirc)
that could actually be genuinely useful if ...if you make list truthiness containing-truthy and then evaluating the truthiness of a list of functions could check if any of them returns truthy
i won't advocate for making list truthiness containing-truthy though lol
The optimal list truthiness algorithm is: take all of the odd numbered items, and take the inverse of their truthiness. Take the squareroot of the sum of these values. Take the other items and reverse them, then take all of the overlapping pairs. Take the truthiness of the first item in each of these overlapping pairs, and multiply it by the second item. Take the product, and compare it to the squareroot value you previously got. If one of them is exactly twice as much, the list is truthy.
Given an input value \$n\$, construct an array of \$n\$ random 128 bit (unsigned) integers. The integers should be uniformly random.
Your code can use any in built random number generation function it has. Clearly this challenge is harder (and more fun) in lower level languages.
and when I "asked" you what your favourite colour was, it had me starting to doubt you actually had a favourite colour
> lyxal: @math and why is that? math: green-ness? lyxal: @math oh please, you can do better than that. lyxal: now I'm curious if you have a favorite color or not. math: uh... blue? lyxal has left the chat
Is it a mathy-county-number
So I recently reinvented some boring type of number.
Reinvented because I'm sure somebody else invented it before, but 'till figure out who actually invented it, let's call these numbers mathy-county-numbers.
So what is a mathy-county-number?
It's a number like 3322224...
@hyper-neutrino @user Just thought you might be interested from our last discussion some Catholic lectures that both expound Catholic philosophy while pointing out modern errors because... well that's the title of the lectures. One is ~34min and the other is ~23min. youtu.be/Og-08nUCd3Qyoutu.be/X8F1VYkh5QU
If you do decide to watch them, do let me know your thoughts!
No, not quantum physics, but I thought I might share with you some of my reasoning behind what I said in that conversation and why I said certain things should be expected to be one way or another in that regard.
One or more of the errors touched on in those lectures are ubiquitous and are the cause of many problems in the world, both in one's life, and in all fields of science.
@Ausername Mods will convert answers into comments if the text would be better suited for a comment, because new users with <50 rep occasionally leave an "answer" because they can't comment
@cairdcoinheringaahing I was trying out Commentator, and I noticed what I think is a bug. It seems to start on the rightmost edge of the tape, so -} commands do nothing unless you’ve previously used {- commands: Try it online!
It also looks like if you move left, then move right past the original accumulator, then back to the original accumulator, it’s suddenly back to 0: Try it online!
Background
Due to some unfortunate accident during coding you are now teleported and stranded on an alien planet. You really hope that the locals will be helpful and point to the general direction of how to get home, but before trying to talk to them you want to decipher their language. Fortunate...
They were using recursion to build the array, but by changing that to declaring the array, filling it with 128n, and mapping it with Arnauld's g function (which needs 128n as input anyway) it saved 2 bytes
@hyper-neutrino Well, it was intended to be usable, I'm not sure how successful I was with that :P
@user As with all my languages, my code is entirely self-documenting, so why would I need docs? :P
(aka no, I should probably actually write docs for my existing langs before making a new one)
For some reason, I have PRIVATEVAR as a saved variable name for all programs, but it appears to be completely modifiable and it errors if you access it before assigning it yourself O.o
What are your guys' favorite stack-based langs with a JS interpreter?
(Or an interpreter that compiles to JS)
Doesn't have to be a complete or amazing interpreter. And it doesn't have to be the de-facto one, either. Just that it should be possible to demo in the browser on the client-side
--- Alternatively, has anyone used any of the XYZ2js transpilers for langs like Python?
@AviFS Well, ><> is stack-based, although the fact that it's 2D makes it quite different from a "regular" stack-based language. Here's a JavaScript interpreter.
@AviFS Half-solved! I can use this Underload interpreter in JS. It's also a simple enough lang that I can write the interp myself. Along similar concatenative/functional lines, I found a half-done Joy interp in JS.
But the question is still open! A JS interpreter for a slightly more convenient & standard stack-based lang would be awesome! Something like GolfScript, 05AB1E or Vyxal