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
 
66%
+2 −0
Sandbox Interleave multiple arrays at once

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

Article code-golf
66%
+2 −0
Challenges The Pell Numbers

Python 3, 39 bytes f=lambda x:x if x<2else 2*f(x-1)+f(x-2) Generic recursive implementation Try it online!

posted 4y ago by Quintec‭

Answer
66%
+2 −0
Challenges The Pell Numbers

APL (Dyalog Classic), 20 18 17 16 bytes ⊢/,+.×⍣⎕⍨∘.+⍨⌽⍳2 Matrix implementation, requires ⎕IO←0. Thanks to @Razetime for the idea, -3 bytes by me Try it online! APL (Dyalog Classic), 19 18 byt...

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

Answer
66%
+2 −0
Challenges Ratio limits of fibonacci-like series

Stax, 5 bytes òP^↓Φ Run and debug it Same idea as Quintec's answer. Input as a floating point number. Explanation 1gpun+ 1 start with 1 gp apply the following till a fixpoint...

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

Answer
66%
+2 −0
Challenges "Hello, World!"

PowerShell, 15 bytes "Hello, World!" Try it online!

posted 4y ago by Wasif‭

Answer
66%
+2 −0
Challenges Cumulative Counts

Jelly, 7 bytes =þ`ÄŒDḢ Try it online!

posted 4y ago by hyper-neutrino‭

Answer
66%
+2 −0
Challenges Cumulative Counts

Scala 3, 50 44 bytes ? => ?.indices zip?map(?take _+1 count _.==) Try it in Scastie! This is an annoying, stupid approach. The more elegant one using inits was much longer (x=>x.inits.to...

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

Answer
66%
+2 −0
Challenges Cumulative Counts

Husk, 4 bytes Sz#ḣ Try it online! Explanation Sz#ḣ Sz zip the input ḣ with its prefixes # using the count function

posted 4y ago by Razetime‭

Answer
66%
+2 −0
Challenges Beaver Code Decryption

APL(Dyalog Unicode), 34 29 bytes SBCS Saved 5 bytes thanks to Razetime! {2>s←⌈2÷⍨≢⍵:⍵⋄,⍉↑∇¨s(↑,⍥⊂↓)⍵} Try it on APLgolf! {2>s←⌈2÷⍨≢⍵:⍵⋄,⍉↑∇¨s(↑,⍥⊂↓)⍵} { } ...

posted 4y ago by user‭  ·  edited 4y ago by Shaggy‭

Answer
66%
+2 −0
Challenges Obligatory Quine Challenge

BQN, 14 bytesSBCS ∾⟜•FMT"∾⟜•FMT" Run online! Assumes •FMT will format a string by placing it in quotes, which depends on the BQN system in use. After (⟜) applies its right operand •FMT to the ...

posted 4y ago by Marshall Lochbaum‭

Answer
66%
+2 −0
Challenges Truthify an array

Scala 3, 68 bytes _.zipWithIndex.flatMap(_.zipWithIndex.filter(_._1)map(_._2)map _.->) Try it in Scastie! Takes a List[List[Boolean]], returns a List[(Int, Int)]. This abuses underscores a ...

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

Answer
66%
+2 −0
Challenges Win a War (or at least a few battles)

BQN, 44 bytesSBCS +´{(≠↑𝕨-𝔽)⊸+2↓⊑∨(≍×𝕨≥⊢)○𝔽˜⟜×⊸∾¨(<1+𝕩)×⥊↕2¨𝕩} Run online! The solution is a function that takes n as the left argument (𝕨) and A as the right argument (𝕩). k is just the le...

posted 4y ago by Marshall Lochbaum‭

Answer
66%
+2 −0
Challenges Length of a Sumac Sequence

BQN, 15 bytesSBCS {𝕨(1+⊢𝕊-)⟜𝕩⍟>0} Run online! A block function that takes $t_1$ as the left argument 𝕨 and $t_2$ as the right argument 𝕩. In BQN, 𝕊 indicates recursion on the current block ...

posted 4y ago by Marshall Lochbaum‭

Answer
66%
+2 −0
Challenges Length of a Sumac Sequence

Scala, 83 bytes x=>x.init#::Stream.iterate(x)(x=>x++(x,x.tail).zipped.map(_-_))indexWhere(_.last<1) Try it online! Takes input as a list of two numbers. The fact that the length can...

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

Answer
66%
+2 −0
Challenges Weave Strings Together

BQN, 8 bytesSBCS ∾⊒˜¨⊔○∾⊢ Run online! and parsing diagram The idea here is to build a list of groups, with group i containing the ith character of each string that has one, then join the group...

posted 4y ago by Marshall Lochbaum‭

Answer
66%
+2 −0
Challenges Make my number a set

Jq, 19 bytes def s:[range(.)|s];

posted 4y ago by Wezl‭

Answer
66%
+2 −0
Challenges Juggler sequences

Python 3, 64 bytes def f(n): z=[n] while n>1:n=int(n**((n+.5)%2));z+=n, return z Try it online!

posted 4y ago by SherlockSage‭

Answer
66%
+2 −0
Challenges Truthify an array

JavaScript (Node.js), 68 bytes f=(a)=>a.map((x)=>[...x.entries()].filter((e)=>e[1]).map((e)=>e[0])) Run the function f on your input, e.g. f([[1,0,1],[1,0,1],[0,1,0]]). The output ...

posted 4y ago by forestbeasts‭

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

Haskell, 64 bytes main=do a<-getLine;putStr$"main=getLine>>=print.("++a++"+).read" Try it online! Run both programs

posted 4y ago by Hakerh400‭

Answer
66%
+2 −0
Challenges Make my number a set

Ruby, 27 bytes ->n{x=[];n.times{x<<x*1};x} ->n{ } # lambda taking n x=[]; # set x to empty array n.times{ }; # repeat...

posted 4y ago by snail_‭

Answer
66%
+2 −0
Meta Default Rules: Loopholes

Sneakily using macros In a code golf challenge, you are tasked to use as small bytes as possible. However, it's considered unacceptable in a language like C to use macros to hide code or shorten i...

posted 4y ago by General Sebast1an‭

Answer
66%
+2 −0
66%
+4 −1
Meta Default Rules: Loopholes

Bypassing source restrictions by storing data in the file name In some languages, like Pxem, programs are usually stored in the file name and the file's contents are irrelevant. On Somewhere Else,...

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

Answer
66%
+2 −0
Challenges Cumulative Counts

JavaScript (Node.js), 34 29 26 bytes -5 bytes thanks to Shaggy's suggestion on a similar challenge -3 bytes again thanks to Shaggy! a=>a.map(d=v=>d[v]=-~d[v]) Try it online!

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

Answer
66%
+2 −0
Meta Default Rules: Random

What is random defined as on this site? How are answers allowed to handle random chance?

2 answers  ·  posted 4y ago by Quintec‭  ·  last activity 4y ago by Quintec‭

Question default-rules