I just stick to having my language on TIO :P I could try making one tho and see how well it works out
especially for the languages with more flexibility/features i'm worried about bringing down my server so having it on TIO's nice cuz dennis did smart things and it won't cause security issues or anything
and if I knew whether or not it's even possible to run a Haskell program off a webpage without having, like, my own server to uhh send requests to or whatever TIO does
These days you can target WebAssembly and host almost any language statically, at least in theory. In practice there's a few practical problems atm with doing stuff like this, but in a few years time it's not unthinkable to have a statically hosted TIO that runs languages in the user's browser via WASM
@Bubbler Does that ever happen? One could also envision a small language core, with task-specific modules being fetched from the static server when first needed.
A centered hexagonal number is a centered figurate number that represents a hexagon with a dot in the center and all other dots surrounding the center dot in a hexagonal lattice.
Illustration of initial terms:
.
. o o o o
. o o o o o o o o
...
How to rotate the sequence S starting from ith element to jth element. In
other words, the ith element swaps its position with that of the jth element, (i+1)th
element swaps its position with that of the (j − 1)th element, and so on in O(log n) time, using augmented red black tree.
A centered hexagonal number is a centered figurate number that represents a hexagon with a dot in the center and all other dots surrounding the center dot in a hexagonal lattice.
Illustration of initial terms:
.
. o o o o
. o o o o o o o o
...
You place a standard die at the origin of a 2D grid that stretches infinitely in every direction. You place the die such that the 1 is facing upwards, the 2 is facing in the negative y direction, and the 3 is facing in the positive x direction, as shown in the figure below:
You then proceed to e...
Palindrome distance
Find what is the distance for a given string to its closest palindrome of the same length.
For this task I decided to give the characters further away from the string's center more weight (think of it as contributing more torque), proportional to their distance to the center.
...
Background
There is an interesting question on MathSE about some conjectures that are disproven by extremely large counter-examples. This delightful answer tells the story of a sequence of numbers called Gijswijt's sequence, which is now registered as A090822. The sequence is defined as follows
...
Does anyone know how much work it takes to write an interpreter for a high level language? I came up with a concept for one but don't want to start writing it if it'll take more than a few months.
I am trying to solve the City Tour problem from InterviewBit. I am getting wrong answer for the below input.
This is my solution below:
#define M 1000000007
void computerFactorial(long long *fact, int n)
{
fact[0] = 1; fact[1] = 1;
for(int i = 2; i <= n; i++)
{
fact[i] ...
I'd consider Rutger to be a "high level" language (at least syntax-wise), and once the tokeniser and parser were done, everything else was fairly alright
You can have some bits of syntax that are "golfier" and equivalents that are more "readable"
You could even have it so that one version has different precedence than the other, so a and b or c => (a) and (b or c) whereas a && b || c => (a && b) || (c)
One of the features of my language will be that almost every aspect of the syntax (except a few core operators) would be in imported packages, so if someone didn't like the default they could change the it to whatever they want anyway.
Odd, I had no idea SE used a STV for their elections. I'd think it would just be something like add three points if first choice, two if second, one if third
Actually it seems that I'm the odd one. There don't seem to be any common voting methods that work like that.
Ah, okay :P If you're just getting started, I'd say 05AB1E is probably a good choice; it's stack-based so it's considerably less annoying to understand than, say, Jelly.
the structure is really hard, took me a couple months to get like somewhat familiar with it and even now I sometimes get confused just by the core syntax of it
Ah. Yeah, I eventually picked up Jelly cuz I got tired of golfing in Python. Throwback to when I first did code-golf exclusively in Java :P it's not bad for some purposes and one guy on this server uses it a lot and does it really well
TBH the main complaint I have with 05AB1E is the choice of builtins seems much more specific than Jelly's more generalised approach, which can save 05AB1E answers a lot of bytes in certain challenges
@cairdcoinheringaahing oops yeah xD @RedwolfPrograms if you ever want to learn Jelly join us in Jelly Hypertraining lmao
@cairdcoinheringaahing oh yeah definitely; in a lot of challenges especially simpler ones, 05AB1E beats Jelly by a byte or two just because Jelly's weak point is its double-byte built-ins that 05AB1E has for two bytes
very sad when the solution has one straightforward optimal approach that any (non-wack) language has to use to be competitive and Jelly just can't compete because of its builtins
though that's better now with a lot of the two-byte common quicks becoming aliased to a single byte
@HyperNeutrino @Mr.Xcoder left a brilliant explanation of how Jelly's program structure works in JHT, it seems to have a couple of users properly grasp exactly how Jelly executes programs
Funny story actually, I wrote up my nomination/QA at about 2am and decided to post it in the morning so I could answer any questions promptly, woke up, saw HN nominated themselves and went "Ah well, might as well still go with it"
@Mr.Xcoder Add in the fact that 2 failed mod elections could lead to the site being shut down, and no-one wanted to risk even the first failing
I was wondering... I've got CGCC as my first browser bookmark and I still (sort of) tap on it daily and stuff, but I never actually read the content/I exit immediately; this feels like a sort-of-weird habit, does anybody else do it? :C
6 are chat rooms, 2 are recent main/meta, 5 I use for review tasks, 1 is my profile, 1 is the Sandbox, 1 I just closed and the rest are just one off tabs I use occasionally :P
Jelly, 8 bytes
”*x³s⁵j⁷
Try it online!
How it works
”*x³s⁵j⁷ Main link. No arguments.
”* Yield '*'.
x³ Repeat the character 100 times.
s⁵ Split into chunks of length 10.
j⁷ Join, separating by linefeeds.
it can get down to 7 with Y but that was apparently added after the challenge was posted (though language version rules have changed since then, if I remember correctly)
okay cool. yeah i remember the whole "non-competing" answer thing eventually just got removed cuz it wasn't helping the site/community anyhow and didn't really have a purpose anymore
i still cannot figure out how to clear stars and i'm sad
@cairdcoinheringaahing oh, lol. oops i didn't keep looking i just stopped after i found the first one :P and i'm sorting by oldest so that's not a good idea
@Mr.Xcoder just cleared the stars :P took me a while to find the option because it's only available in the sidebar ._. but after i found it it took like 2 minutes :P