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
 
60%
+1 −0
Sandbox The Camelot Wheel [FINALIZED]

posted 4y ago by Quintec‭  ·  edited 2y ago by trichoplax‭

60%
+1 −0
Challenges Longest Increasing Subsequence

Husk, 10 bytes L►LfΛo<0-Ṗ Try it online! Explanation L►LfΛo<0-Ṗ Ṗ power set of input f get elements which match the following: Λo - all pairwise difference...

posted 4y ago by Razetime‭  ·  edited 4y ago by Razetime‭

Answer
60%
+1 −0
Challenges Create a range grid

Python 3, 49 bytes lambda m,n:[[*range(n*_,n*_+n)]for _ in range(m)] Try it online!

posted 3y ago by orthoplex‭

Answer
60%
+1 −0
Challenges Create a range grid

Python 2, 46 bytes lambda m,n:[range(n*_,n*_+n)for _ in range(m)] Try it online!

posted 3y ago by orthoplex‭

Answer
60%
+1 −0
Challenges Create a range grid

C (gcc), 59 bytes i;f(m,n){while(i<m*n){putchar(i%n?32:13);putchar(48+i++);}} Attempt This Online! m is the number of rows. n is the number of columns.

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

Answer
60%
+1 −0
Challenges Create a range grid

BQN (CBQN), 10 bytes Anonymous function that takes m on the left and n on the right. {𝕨‿𝕩⥊↕𝕨×𝕩} ↕𝕨×𝕩 # list of range [0,m*n) 𝕨‿𝕩⥊ # reshape list to m*n Try it here!

posted 3y ago by snail_‭  ·  edited 3y ago by snail_‭

Answer
60%
+1 −0
Challenges Collatz conjecture; Count the tries to reach $1$

C (gcc), 43 38 bytes f(i){return i>1?f(i%2?3*i+1:i/2)+1:0;} Attempt This Online! Credits to @Moshi for shortening the code.

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

Answer
60%
+1 −0
Meta Does Looping Counter qualify as kolmogorov-complexity?

Lundin just suggested in a comment under another question that I tag the challenge Looping Counter as kolmogorov-complexity. Now I'm not sure if it actually qualifies for that tag, for the followi...

1 answer  ·  posted 3y ago by celtschk‭  ·  last activity 3y ago by Razetime‭

Question discussion tags
60%
+1 −0
Challenges Collatz conjecture; Count the tries to reach $1$

Wolfram Language (Mathematica), 38 bytes Tr[1^ResourceFunction["Collatz"]@#]-1& Don't Try it online! Doesn't work on TIO due to using the Collatz builtin which needs to be downloaded from ...

posted 3y ago by romanp‭  ·  edited 3y ago by romanp‭

Answer
60%
+1 −0
Sandbox Double the Size of an Image

posted 3y ago by romanp‭

Article code-golf image
60%
+1 −0
Challenges Roll n fair dice

C (gcc), 48 43 bytes s;r(n,m){s+=rand()%m+1;return--n?r(n,m):s;} Try it online! Previous 48 bytes version using loop: i,s;r(n,m){for(;i<n;i++)s+=rand()%m+1;return s;}

posted 3y ago by Lundin‭  ·  edited 3y ago by Lundin‭

Answer
60%
+1 −0
Challenges Roll n fair dice

Python 3, 59 bytes lambda n,m:sum(choices(range(m),k=n))+n from random import* Try it online!

posted 3y ago by celtschk‭

Answer
60%
+1 −0
Challenges From the smallest seed

Zsh, 61 bytes n=2;s=s=%q\;printf\ n=\$n\$n\\\;\$s\ \$s;printf n=$n$n\;$s $s Attempt This Online! A trivial modification of this quine: s=s=%q\;printf\ \$s\ \$s;printf $s $s. n goes from 2 to 22 ...

posted 3y ago by user‭

Answer
60%
+1 −0
Challenges Collatz conjecture; Count the tries to reach $1$

J, 35 char <:#-:`(>:@:*&3)@.(2&|)^:(1&<)^:(<_) How it works: NB. <: subtract one from number result on right NB. # count number of items from list result on righ...

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

Answer
60%
+1 −0
Challenges From the smallest seed

HQ9+, 2 bytes Two quines. QQ

posted 3y ago by orthoplex‭

Answer
60%
+1 −0
Challenges Looping counter

J, 13 char '*',^:(<_)'*' How it works: What's in parenthesis indicates to the verb ^: that the verb to the left of ^: has to be performed to the object on the right of the ^: an infinite nu...

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

Answer
60%
+1 −0
Challenges Determine whether an integer is square-free

J, 7 char *./~:q: How it works: 'q:' produces prime factors of number on right '~:' replaces the first instance of unique numbers with a 1, the rest 0 '*./' tests for all ones Sample runs: ...

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

Answer
60%
+1 −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 3y ago by torres‭

Answer
60%
+1 −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 3y ago by torres‭

Answer
60%
+1 −0
Sandbox Code bowling using unique characters

posted 3y ago by Lundin‭  ·  edited 3y ago by Lundin‭

60%
+1 −0
Challenges Make a frequency table (histogram)

Python 3, 38 36 33 bytes lambda x:{n:x.count(n)for n in x} -2 bytes thanks to @Razetime Another -3 bytes thanks to @orthoplex Attempt it online!

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

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

J, 8 bytes ~.,:#/.~ Tacit function, this is the de facto method for this problem in J. Attempt it online!

posted 3y ago by south‭

Answer
60%
+1 −0
Challenges Cumulative Counts

J, 24 char ([: +/ [: (* +/\ )"1 ~. ="0 1 ]) Sample Runs ([:+/[:(*+/\)"1~.="0 1]) 1 1 2 2 2 1 1 1 3 3 1 2 1 2 3 3 4 5 1 2 ([:+/[:(*+/\)"1~.="0 1]) 3 7 5 4 9 2 3 2 6 6 1 1 1 1 1 1 2 ...

posted 3y ago by torres‭

Answer
60%
+1 −0
Challenges Cumulative Counts

J, 9 bytes 1#.]=&><\ This is the 7 byte APL solve but makes use of #. in place of +/"1. I came up with 1#.]=[\ first, but bubbler pointed out it breaks when non zeros are present. At...

posted 3y ago by south‭

Answer
60%
+1 −0
Challenges Cumulative Counts

Python 3.8 (pre-release), 69 bytes def f(x,y={},z=[]): for i in x:y[i]=y.get(i,0)+1;z+=[y[i]] return z Try it online! Bonus: theoretical answer if python allowed named assignment with su...

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

Answer