Uh, loads. There are over 50 functions and any sequence of those is a legal program. Then there are a dozen or so operators which must have either a function on their left or on both sides (depending on the specific operator)…
And write a brute-force program using that, checks each combination of n length, however our task will be easier for 1-byte programs, from 2-byte, we have to calculate all of the 1114112 because each of the character can be prepended with a comment, resulting in legal program
@Anush well the thing is that it's either a) only available for languages with exec and try/catch or b) for a specific language defined by the question
@Anush are we considering input? And if it isn't a brute force approach, how is one to prove that it actually does calculate the total non-erroring programs?
weird fact: consider that there are an infinite number of prime pairs. but, they get less dense as you go up the list of primes. in fact, prime gaps of 6 overtake them. if you go up high enough (10^34) then prime gaps of 30 overtake gaps of 6. then 210, then 2310... yes it's the primorials that set the records for most frequent prime gaps.
Speaking of stupid things I did at school, I found amusement in drawing stick figures dabbing on whiteboards around the campus
Also, in our classroom there was an adjustable desk (like the type you can push a button and it moves up and down). I found it funny to make it go as high as it could before the teacher came in. Eventually, she saw it and said "well I know Lyxal is here today"
Why did I use typescript for my TIO clone?! It's not helped me whatsoever yet and has only made me spend an hour a day adding : any after every few commits
Ash is going to be a bit of a weird mix of overloading and vectorization. The first argument is almost always used for overloading, but the rest of them typically just vectorize.
also did they discontinue the app or something? i tried to find it on the play store to update it in case mine was out of date and i can't find it anymore
@Lyxal do you know of a way to get to meta on your SE app, and if so, can i have a copy of your app :P I have one downloaded but it could be an older version than the last publically available one
Yeah, they've fully stopped dev on the apps. Not too familiar with the android app, but on iOS, click the meatball menu "More" at the bottom of the screen when you're on Code Golf's question page, then "Switch to meta site". Hopefully it's similar on Android?
@Anush I've gone with "syntaxically valid" meaning "this only breaks on some/empty input", rather than "it errors". Jelly has 156 1 byte atoms. The only way a 1 byte program can contain a quick is if the quick is an "actor", of which there are 9 (these technically recurse forever, but there are syntaxically valid). There's then the various syntax characters, adding 23 more programs. Finally, any unimplemented symbol is a valid 1 byte program (due to parsing weirdness), so that's 23.
That produces a total of 211 out of a possible 256 1 byte programs
Wait, no, sorry, there are only 6 actors that are syntaxically valid 1 byte programs, so 208 / 256
Hang on again, Jelly's quicks can exist in 1 byte programs, but only a few of them. I'll get back to you with a correct answer in a second :/
So: 156 1 byte atoms, all syntaxically valid. 14 quicks; 6 are "syntaxically valid", 8 just don't throw an error in a 1 byte program but don't really match up with their proper syntax. 26 syntax characters. 23 unimplemented characters. Total: 219 / 256
Im going to go work on the answer for \$n = 2\$ :P
KotH: Assembly Anarchy
Draft. Just posting this so I don't forget I had this idea. Feel free to suggest improvements to the general idea here.
Basically, there would be a computer with memory and a processor. Programs would be submitted in a custom assembly language, and they would try to run a f...
I'm solving Weird Algorithm problem. The problem has been solved but facing an OUTPUT LIMIT EXCEED issue. Searched a lot but could not find any way to get rid of this issue.
#include<iostream>
using namespace std;
void fun(int n)
{
if(n!=1){
if(n%2==0)
{
n=n/2;
...
I am trying to find a site where, instead of codegolfing, one can post (or see) good snippets to do a common task. Ie, not an obscure, codegolfed, one, but a clear, concise, elegant one, in several langages.
it's quite a good start, thank you @Adám. (I initially was looking at : codegolf.stackexchange.com/questions/44680/… but lamenting that the answers are often too short to be meaningful, and so do not exactly showcase a langage feature, just it's codegolfing possibilities)
In mathematics and computer science, a higher-order function is a function that does at least one of the following:
takes one or more functions as arguments (i.e. procedural parameters),
returns a function as its result.All other functions are first-order functions. In mathematics higher-order functions are also termed operators or functionals. The differential operator in calculus is a common example, since it maps a function to its derivative, also a function. Higher-order functions should not be confused with other uses of the word "functor" throughout mathematics, see Functor (disambiguation...
Tags: code-golfunicodestringconversion
Interpret a Cangjie Input Method String
The Cangjie input method is a method for inputting Chinese characters using a standard QWERTY-like keyboard. Each Chinese character is encoded as a sequence of Latin letters, each letter representing a radical, or part...
@OriginalOriginalOriginalVI : no, not really what I'm looking for (good exemples in a given (yet unknown or not fully groked) langage. RosettaCode may be good (but some exemples are not great...)
I suggested the synonym. If anyone here has 5 score in encoding, you should be able to vote on it. If you don't, if you post some answers on encoding you should definitely get a few upvotes and be able to vote
@Adám : if you know good ones, yes. I found a few good videos on Derek Banas youtube (good because: short enough for an experienced programmer/scripter to see the main features and syntax of a new langage in a few minutes instead of hours, and covering enough material in 1h or less to be usefull)
@OriginalOriginalOriginalVI Well decode definitely shouldn't be a synonym of encode, but encoding is more broadly about methods of encoding/decoding, in the same way that encryption can also refer to decryption in a vaguer sense, so I think it should be.
I want to grok at least : lisp (common lisp, scheme, or maybe new variants), python, perl, Golang, prolog, smalltalk. Bonus point (for an unrelated/tangent request) if you know GOOD videos about functionnal programming (difficult to find good ones.. Just found 2 recently, by the same guy : Scott Wlaschin)
I see your point, but the main reason I usually don't upvote every new answer is that I try to prioritize ones on my questions since there's a max of 40/day
Otherwise I totally would upvote them normally
It'd be unethical for sure if it was because of who was posting it, but IMO upvoting an already good answer when it also helps with site cleanup is fine
Irritatingly, I have a score of 15 in decode, but that doesn't mean I can suggest it as a synonym of encoding, as I need a score of 5 in encoding to suggest tags as synonyms of it ಠ_ಠ
@RedwolfPrograms bug with New Posts: if the post expires without you clicking on the tab, it still shows (1) in the tab, but visiting the page shows no posts
We're going rootin' tootin' cow-poke shootin!
This is a simple contest, first program to draw their pistol wins.
How it works:
I require 2 things from you, an executable, and a command to be run
from a bash terminal.
The executable needs to do one thing: wait
until it receives 'draw!' from STDIN...