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.6k posts
 
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 2y ago by Zakk‭  ·  edited 2y 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 2y ago by celtschk‭  ·  last activity 2y 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 2y ago by romanp‭  ·  edited 2y ago by romanp‭

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

posted 2y 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 2y ago by Lundin‭  ·  edited 2y 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 2y 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 2y 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 2y ago by torres‭  ·  edited 2y ago by torres‭

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

HQ9+, 2 bytes Two quines. QQ

posted 2y 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 2y ago by torres‭  ·  edited 2y 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 2y ago by torres‭  ·  edited 2y ago by torres‭

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

posted 2y ago by Lundin‭  ·  edited 2y 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 2y ago by south‭  ·  edited 2y 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 2y ago by south‭

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

Myby, 12 5 bytes primf=primfd primf : prime factors = : equals primfd : unique prime factors Evaluated as a monadic fork in J (f y) g (h y). The test cases (retest...

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

Answer
60%
+1 −0
Challenges Reduce over the range [1..n]

Factor, 95 bytes USING: kernel ranges sequences ; IN: r : r ( n q -- n ) [ [1..b] [ ] ] dip map-reduce ; inline

posted 2y ago by gifti‭

Answer
60%
+1 −0
Challenges Find n Niven Numbers

Factor, 147 bytes USING: kernel math math.text.utils sequences ; IN: n : n ( n -- s ) 0 swap [ [ 1 + dup dup 1 digit-groups sum mod 0 > ] loop dup ] replicate nip ;

posted 2y ago by gifti‭

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

Factor, 46 bytes USE: math.statistics IN: h ALIAS: h histogram

posted 2y ago by gifti‭

Answer
60%
+1 −0
Challenges Find n Niven Numbers

Ruby, 56 bytes p *(1..).lazy.filter{_1%_1.digits.sum<1}.take(gets.to_i) Attempt This Online!

posted 2y ago by south‭

Answer
60%
+1 −0
Challenges Multiply complex numbers.

Sidef, 25 bytes {eval .split.join(" * ")} {eval .split.join(" * ")} { } # Create anonymous code block .split.join(" * ") # splits on whitespace and joins with "...

posted 2y ago by south‭

Answer
60%
+1 −0
Challenges Find n Niven Numbers

x86-64 machine code, 36 bytes 31 C0 8D 48 0A FF C0 50 99 89 17 48 F7 F1 01 17 99 85 C0 75 F6 58 50 F7 37 58 85 D2 75 E7 AB FF CE 75 E2 C3 Try it online! Following the standard calling conventi...

posted 2y ago by m90‭

Answer
60%
+1 −0
Challenges Multiply complex numbers.

Python 3, 63 bytes print(str(eval(f"({input().replace(' ',')*(')})")).strip("()")) Try it online! Similar to hyper-neutrino‭'s answer. Doesn't replace i by j and back, and uses f-string instea...

posted 2y ago by __blackjack__‭

Answer
60%
+1 −0
Challenges Looping counter

JavaScript, 25 bytes Could be 21 but calling the function like that feels like cheating. (f=s=>f(s+=8,print(s)))`` Try it online! 22 bytes Didn't want to post this as my main solution a...

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

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

Japt, 5 bytes k eUâ Try it

posted 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges Looping counter

Japt, 6 bytes ßOpP±Q Test it ßOpP±Q ß :Recursive call Op :Output with trailing newline P :Empty string, initially ± :Append Q :Quotation mark

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

Answer