Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Search

Advanced Search Options

To further refine your search, you can use additional qualifiers such as score:>0.5. For example, the search score:>=0.5 created:<1y grammar would return only posts mentioning "grammar" that have a score >= 0.5 and were created less than a year ago.

Further help with searching is available in the help center.

Quick hints: tag:tagname, user:xxx, "exact phrase", post_type:xxx, created:<N{d,w,mo,y}, score:>=0.5

Filters
1.5k posts
 
50%
+0 −0
Challenges Diagonalized alphabet

C (clang), 206 bytes main(i){char*s="YWUSQOMKIGECABDFHJLNPRTVXZ";for(i=13;i>0;printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",s[-1+i],s[0+i],s[1+i],s[2+i],s[3+i],s[4+i],s[5+i],s[6+i],s[7+i],s[8+i],s[...

posted 2y ago by General Sebast1an‭

Answer
50%
+0 −0
Q&A Tips in golfing using Lua

Convenient whitespace removal Here are instances where you can remove whitespace: Strings If you assigned or printed a string, then the next supposed line of code can lean on the right double-qu...

posted 2y ago by General Sebast1an‭

Answer
50%
+0 −0
Challenges A number adder, not a death adder

Lua, 51 bytes P1: print("print(tonumber(io.read())+"..io.read()..")") Try it online! P2 (given I inputted 10, 29 bytes): print(tonumber(io.read())+10) Try it online!

posted 2y ago by General Sebast1an‭

Answer
50%
+0 −0
Challenges Getting perfect squares, differently

Lua, 41 40 bytes x=0 y=1while""do print(x)x=x+y y=y+2 end Try it online!

posted 2y ago by General Sebast1an‭  ·  edited 2y ago by General Sebast1an‭

Answer
50%
+0 −0
Challenges It's Hip to be Square

JavaScript (V8), 13 bytes x=>x**.5%1==0 Try it online!

posted 2y ago by Zakk‭

Answer
50%
+0 −0
Challenges It's Hip to be Square

Lua 5.4, 9 bytes n^.5%1==0 Try it online! The entire compressed code is 33 bytes: function f(n)return n^.5%1==0 end Try it here. It's not clear whether the rules allow the first form (i...

posted 2y ago by Zakk‭

Answer
50%
+0 −0
Challenges It's Hip to be Square

C (gcc), 37 bytes f(n,p){while(++p*p<n);return p*p==n;} Try it online! The solution is based on the simple fact that: $$\forall n \in \mathbb{N}, n \text{ is a perfect square} \Longleftrig...

posted 2y ago by Zakk‭  ·  edited 2y ago by Zakk‭

Answer
50%
+0 −0
Challenges Create a range grid

Lua 5.4, 76 bytes function(m,n)for i=0,m*n-1 do _=(i%n==0)and print()or io.write(i,' ')end end Try it online!

posted 2y ago by Zakk‭  ·  edited 2y ago by Zakk‭

Answer
50%
+0 −0
Challenges Create a range grid

MATL, 8 bytes tp:qwPe! Try it online! tp:qwPe! t : duplicate with implicit input (function args as array) p : product [2 3]p -> 6 : : range 1..n q : decremen...

posted 2y ago by south‭  ·  edited 2y ago by south‭

Answer
50%
+0 −0
Challenges Word Count Tool

Lua 5.4, 62 bytes _,w=s:gsub('%w+',0)_,c=s:gsub('[^\n]',0)_,n=s:gsub('[%g\t]',0) Attempt This Online! Another version, 65 bytes: p={'%w+','[^\n]','[%g\t]'}for i=1,#p do _,r[i]=s:gsub(p[i],'...

posted 2y ago by Zakk‭  ·  edited 2y ago by Zakk‭

Answer
50%
+0 −0
Challenges Word Count Tool

JavaScript (Node.js), 60 bytes s=>[/\w+/g,/./g,/[\S\t]/g].map(p=>(v=s.match(p))?v.length:0) Attempt This Online!

posted 2y ago by Zakk‭

Answer
50%
+0 −0
Challenges Word Count Tool

Wolfram Language (Mathematica), 70 bytes {Tr[1^StringSplit@#],StringLength@#,StringLength@StringDelete[#," "]}& Try it online! What made me decide to use Mathematica for string processing?...

posted 2y ago by romanp‭

Answer
50%
+0 −0
Challenges Word Count Tool

Python 3.8, 73 bytes lambda x:[len(x.split()),len(x.replace('\n','')),len(''.join(x.split()))] Try it online!

posted 2y ago by dino‭

Answer
50%
+0 −0
Challenges Make $2 + 2 = 5$

J, 17 char +/`5:@.(2*./@:=]) How it works: What's within parentheses tests if both numbers on the right are 2. If so, the verb agenda @. selects the verb 5: which is always 5. If not, the ve...

posted 2y ago by torres‭  ·  edited 2y ago by torres‭

Answer
50%
+0 −0
Challenges The Pell Numbers

J, 30 char ((2*%:2)%~(1+%:2)&^-(1-%:2)&^) ((2*%:2)%~(1+%:2)&^-(1-%:2)&^) 0 0 ((2*%:2)%~(1+%:2)&^-(1-%:2)&^) 1 1 ((2*%:2)%~(1+%:2)&^-(1-%:2)&^) 2 2 ...

posted 2y ago by torres‭

Answer
50%
+0 −0
Challenges Solve Goldbach's Conjecture

J, 46 char ({.(+/m)#a),{:(+/"1 m=:x=+/~a)#a=:p:i._1 p:x=: Sample runs ({.(+/m)#a),{:(+/"1 m=:x=+/~a)#a=:p:i._1 p:x=:4 2 2 ({.(+/m)#a),{:(+/"1 m=:x=+/~a)#a=:p:i._1 p:x=:6 3 3 ({.(+/m)#a),{:...

posted 2y ago by torres‭

Answer
50%
+0 −0
Challenges Are All Elements Equal?

J, 5 char 2>#~. How it works: '~.' produces list of unique elements of list on its right '#' counts how many elements in the list on its right '2>' tests if number on its right only ha...

posted 2y ago by torres‭

Answer
50%
+0 −0
Challenges A number adder, not a death adder

J, 7 char '+/',": Sample runs: '+/',": 6 +/6 +/6 5 11 '+/',": 55 +/55 +/55 45 100

posted 2y ago by torres‭

Answer
50%
+0 −0
Challenges Golf a FRACTRAN interpreter

J, 36 char {._2{(}.,~(=<.)@v{.@#v=.}.*{.)^:(<_) Sample runs: {._2{(}.,~(=<.)@v{.@#v=.}.*{.)^:(<_) 1096135733 78r55 5r3 1r5 11r2 5r7 328842888196762472689573703 {._2{(}.,~(=...

posted 2y ago by torres‭  ·  edited 2y ago by torres‭

Answer
50%
+0 −0
Challenges "Hello, {name}!"

J, 29 char ('!',~'Hello, ',1!:1<1)1!:2<4 Sample run ('!',~'Hello, ',1!:1<1)1!:2<4 torres Hello, torres!

posted 2y ago by torres‭

Answer
50%
+0 −0
Challenges Find the IP address class

J, 46 char 'ABCDE'{~<:0 128 192 224 240 I.>:".{.}.;.1'.', Sample runs 'ABCDE'{~<:0 128 192 224 240 I.>:".{.}.;.1'.', '127.255.255.255' A 'ABCDE'{~<:0 128 192 224 240 I...

posted 2y ago by torres‭

Answer
50%
+0 −0
Challenges Keyword golfing

C (gcc), 358 bytes static inline _Noreturn float f(union u);extern _Thread_local _Complex long double*restrict B;main(void){_Atomic register enum {A};typedef _Alignas(unsigned char)struct S;_Sta...

posted 2y ago by Lundin‭  ·  edited 9mo ago by Lundin‭

Answer
50%
+0 −0
Challenges "Hello, World!"

JavaScript V8, 26 bytes console.log`Hello, World!`

posted 2y ago by danibarker‭  ·  edited 2y ago by danibarker‭

Answer
50%
+0 −0
50%
+0 −0
Challenges Make a frequency table (histogram)

JavaScript (Node.js), 38 32 bytes -6 bytes thanks to Shaggy! a=>a.map(v=>d[v]=-~d[v],d={})&&d Try it online! Basically just this but returning the result

posted 2y ago by Moshi‭  ·  edited 1y ago by Moshi‭

Answer