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
 
75%
+4 −0
Challenges Truthify an array

C (gcc), 100 bytes i,j;f(x,y,p)int*p;{puts("[");for(;i<x;i++)for(j=0;j<y;j++)*p++&&printf("[%d,%d],",i,j);puts("\b]");} Try it online! Note that TIO console doesn't handle back...

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

Answer
81%
+7 −0
Challenges Truthify an array

JavaScript (Node.js), 74 70 bytes Works for any number of dimensions. f=(a,z=[])=>a.map?.((b,c)=>z.push(...f(b).map(a=>[c,...a])))?z:a?[z]:z Try it online! (TIO uses an old version ...

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

Answer
81%
+7 −0
Challenges Truthify an array

Jelly has an atom called untruth, which when given indices, creates an array with 1s at those places: [2,4] → [0,1,0,1]. You are required to perform the inverse of this. Given a 2D boolean array, ...

10 answers  ·  posted 3y ago by Razetime‭  ·  last activity 2y ago by General Sebast1an‭

77%
+5 −0
Meta Should sandbox posts give rep?

Update: we can do this more easily now. We can change the reputation grants per post type per category, both up and down, without creating a new post type. Sandbox posts would continue to use the...

posted 3y ago by Monica Cellio‭  ·  edited 3y ago by Monica Cellio‭

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

Jelly, 9 bytes Rȧ_@Rп@L Try it online! Takes $t_1$ on the left and $t_2$ on the right. R}ȧ_@RпL works given the arguments in the opposite order. R Ascending range from 1 to t_1 (...

posted 3y ago by Unrelated String‭  ·  edited 3y ago by Unrelated String‭

Answer
60%
+1 −0
Challenges Tile pyramids on top of each other!

C (compliant), 106 bytes char r,i,s[80];void f(int n){memset(s,32,79);for(;r<n;puts(s),r++)for(i=0;i++<n*2;s[n-r-1]=47,s[n+r]=92);} Try it online! Standard C compliant function solutio...

posted 3y ago by Lundin‭

Answer
66%
+2 −0
Challenges Tile pyramids on top of each other!

Ruby, 43 bytes ->n{(1..n).map{|i|" "*(n-i)+?/*i+?\\*i}*$/} ->n{ } # lambda (1..n).map{|i| } # map over 1 to n ...

posted 3y ago by snail_‭

Answer
71%
+3 −0
Challenges Tile pyramids on top of each other!

V (vim), 11 bytes ÀñY>HGpé/Á\ Try it online! Hexdump: 00000000: c380 fe58 c3b1 593e 4847 70c3 a92f c381 ...X..Y>HGp../.. 00000010: 5cc3 bfc3 \...

posted 3y ago by DJMcMayhem‭

Answer
81%
+7 −0
Challenges Reverse an ASCII string

Brain-Flak, 12 bytes {({}<>)<>}<> Try it online! # (Implicitly) Read characters from STDIN and place them all on the active stack # While the top of the active stack is no...

posted 3y ago by DJMcMayhem‭

Answer
71%
+3 −0
Challenges The Camelot Wheel

Python 3, 101, 98, 94 bytes First answer! lambda s:f"{(('FCGDAEB'.index(s[0])-~-ord(s[5])*('-'in s)-3*('i'in s)-6)%12)+1}"+'BA'['i'in s] Try it online! Readable version: def f(s): n="FCG...

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

Answer
84%
+9 −0
Meta Posting guidelines modifications

Currently, the posting guidelines for Code Golf are the defaults on Codidact. The pre existing guidelines on SE are the following: The main points of discussion are: What would we like to ...

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

Question support discussion
71%
+3 −0
Challenges Evaluate a single variable polynomial equation

Jelly, 1 byte ḅ Try it online! Essentially just Razetime's APL answer, except in that ḅ vectorizes rather than carrying out mixed base conversion--irrelevant if, as is the case here, the provi...

posted 3y ago by Unrelated String‭

Answer
75%
+4 −0
Challenges Calculate a person's age

Challenge Given a date with day, month and year, calculate how old a person born on that day would be today. Input can be in any reasonable format(params, array, date object). Input will never b...

0 answers  ·  posted 3y ago by Razetime‭

Question code-golf date
75%
+4 −0
Challenges Evaluate a single variable polynomial equation

Ruby, 38 bytes Simple map and sum over the coefficients. No TIO link, this uses numbered lambda parameters which require Ruby 2.7. ->l,x{l.each_with_index.sum{_1*x**_2}}

posted 3y ago by snail_‭

Answer
71%
+3 −0
Challenges Golf me a polygonal loader

JavaScript (Browser), 670 bytes for(_="=1,w=):=0,w(=f(||(.join`w?q-w?q=-w(a,b=>A(L*5,a),g.innerText=N=L=D=T,I=,c,d)a-d?I,b(d,cd+1c,A=)I(a,(x,y)[...y,b(x)],[](U=_(Kf=({value:a})a==[a|]+[]&&a...

posted 3y ago by Hakerh400‭  ·  edited 3y ago by ArtOfCode‭

Answer
66%
+2 −0
Challenges Golf me a polygonal loader

CGCC Sandbox, Codidact Sandbox Given three positive integers as input, animate an ascii-art polygonal loading symbol on the screen. Intro Using the first input $n$, Take one the following regul...

1 answer  ·  posted 3y ago by Razetime‭  ·  edited 3y ago by General Sebast1an‭

60%
+1 −0
Challenges The Camelot Wheel

APL (Dyalog Unicode), 110 67 bytes {(⍕((f⊖⍪'AEBFCGDAEBFD'),r⌽12↑¯6↑5⍴'-')⍳2↑⍵),⎕a⌷⍨1+0≠f←¯3+r←3×'i'∊⍵} -43 bytes from dzaima. Requires input exactly as shown in the diagram. A bit fiddly with...

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

Answer
60%
+1 −0
Challenges Integer to Roman numeral

Perl 5 -pMRoman, 10 bytes (17 if including command-line switches) $_=Roman$_

posted 3y ago by msh210‭

Answer
66%
+2 −0
Challenges Bytes to Segfault

Bash, 11 kill -11 $$ Try it online!

posted 3y ago by Nominal‭

Answer
66%
+2 −0
Sandbox The Tannenbaum series

posted 3y ago by Lundin‭

Article code-golf
60%
+1 −0
Challenges Integer to Roman numeral

C (compliant), 197 198 bytes. Golfed version of the function in the question, using X macros: #define L Y(1000,M)Y(900,CM)Y(500,D)Y(400,CD)Y(100,C)Y(90,XC)Y(50,L)Y(40,XL)Y(10,X)Y(9,IX)Y(5,V)Y(4,I...

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

Answer
66%
+2 −0
Challenges Towering Cistercian Representation

JavaScript (Node.js), 606 bytes for(_="=>\\\\ =j(...(a:').join`\\n`[q](/aa),/ / / d[c[___) .match(/.{.||]/g,=='.mapf=(n,m=([a,b]a?m(b)+a',l=10000n,j=, b,c=0a-c?[b(cj,b,c+1)]:[],b=[q='rep...

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

Answer
60%
+1 −0
71%
+3 −0
Challenges The Camelot Wheel

Given a musical key, output its number and letter on the Camelot Wheel (shown below). Input A musical key as a string, as shown on the wheel. The words "Sharp" and "Flat" may be replaced with s...

2 answers  ·  posted 3y ago by Quintec‭  ·  edited 3y ago by General Sebast1an‭

Question code-golf