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
 
50%
+0 −0
Challenges Digit Sum Integer Sequence (working title)

Python 3, 183 181 175 bytes def f(a,b): c=a;a=str(a) for i in range(b): y=0;z=9 for j in range(len(a)): if y<int(a[j]):y=int(a[j]) if z>int(a[j]):z=int(a[j]) c=int(a)+...

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

Answer
50%
+0 −0
Meta Suggestions for the new header banner/background

Binary and code plastered a lot One of the more generic ways of adding design to a code challenge site. The binary digits can be plastered around the header in a way that it looks cryptic. But bin...

posted 3y ago by General Sebast1an‭

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

PHP, 55 27 21 bytes Hello, <?=$argv[1]?>! Try it online! Golfed 28 bytes thanks to my Software CD post. Golfed 6 bytes thanks to @Shaggy's advice.

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

Answer
50%
+0 −0
Challenges 1, 2, Fizz, 4, Buzz!

PHP, 114 bytes <?php for($i=1;$i<101;$i++){if($i%3!=0&$i%5!=0){echo$i;}if($i%3==0){echo"Fizz";}if($i%5==0){echo"Buzz";}echo"\n";} Try it online! As someone who doesn't code much in...

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

Answer
50%
+0 −0
Challenges Evens or Odds - you know this one

PHP, 36 bytes <?php $x=(int)fgets(STDIN);echo$x%2; Try it online! Outputs 1 if odd and 0 if even.

posted 3y ago by General Sebast1an‭

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

Rockstar, 40 bytes listen to N say "listen to N say N-0+"+N Which outputs P2, where X is the input from P1: listen to N say N-0+X Try it here (Code will need to be pasted in)

posted 3y ago by Shaggy‭

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

PHP, 57 bytes <?php $x=0;$y=1;while(1){echo(string)($x+=$y)." ";$y+=2;} Try it online! PHP's a nice language, I tell ya.

posted 3y ago by General Sebast1an‭

Answer
50%
+0 −0
Challenges Expand a polynomial

Haskell, 45 bytes foldl(\a b->zipWith((-).(*b))(0:a)$a++[0])[1] Try it online! Uses the "highest power first" convention. Sometimes multiplies the polynomial by $(-1)$.

posted 3y ago by Hakerh400‭

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

Set arrays without array() In a few occasions, setting an array using array() can be a bit costly. Thankfully, you can assign an array like how to assign a Python list. <?php $a=["Hello","Ma...

posted 3y ago by General Sebast1an‭

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

shortC, 16 bytes AJ"Hello, World! Try it online!

posted 3y ago by General Sebast1an‭

Answer
50%
+0 −0
Challenges Caesar shift cipher

Haskell, 74 bytes a=ord 'a' n!c|isLetter c=chr((rem((ord c -a)+n) 26)+a)|True=c f n=map (n!) Try it online!

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

Answer
50%
+0 −0
Challenges Word Count Tool

Haskell, 47 bytes l=length f s=(l(words s),l s,l$filter(/= ' ')s) Try it online!

posted 3y ago by carmysilna‭

Answer
50%
+0 −0
Q&A Tips for golfing in Python

| == or This bitwise operator can sometimes be used as the replacement for or. a=-2;b=3 if(a>0)|(b>0):print(a+b) Try it online!

posted 3y ago by General Sebast1an‭

Answer
50%
+0 −0
Challenges Obligatory Quine Challenge

shortC, 38 bytes Bs){Rs="Bs){Rs=%c%s%c,34,s,34",34,s,34 Try it online! From GeeksForGeeks's C implementation.

posted 3y ago by General Sebast1an‭

Answer
50%
+0 −0
Challenges Truthify an array

shortC, 78 bytes i,j;f(Ix,Iy,I*p){R"[");O;i<x;i++)Oj=0;j<y;j++)*p++&&R"[%d,%d],",i,j);J"\b]");} Try it online! From @Lundin's C (gcc) answer.

posted 3y ago by General Sebast1an‭

Answer
50%
+0 −0
Challenges 99 Shortened Bottles of Beer

Seriously, 1 byte N Try it online! Yep. lmao

posted 3y ago by General Sebast1an‭

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

Java (JDK), 150 bytes interface M{static void main(String[]a){int i=new java.util.Scanner(System.in).nextInt(),j=0;for(;i!=1;j++){i=i%2==1?i*3+1:i/2;}System.out.print(j);}} Try it online! Fr...

posted 3y ago by General Sebast1an‭

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

Java (JDK), 51 50 23 21 bytes x->y->x==y&y==2?5:x+y Try it online! Golfed 27 bytes thanks to @Moshi's advice. Golfed 2 bytes thanks to @user's advice on Discord.

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

Answer
50%
+0 −0
Challenges Reverse an ASCII string

Java (JDK), 88 83 bytes static void f(String s){for(int i=s.length();i>0;System.out.print(s.charAt(--i)));} Try it online!

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

Answer
50%
+0 −0
Challenges Evaluate a single variable polynomial equation

BQN, 13 bytes {+´(𝕨⋆↕≠𝕩)×𝕩} { } # fn +´ # sum reduce (𝕨⋆↕≠𝕩) # x^i for each term ×𝕩 # times each coefficient Try it

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

Answer
50%
+0 −0
Challenges Evaluate a single variable polynomial equation

Ruby, 29 bytes ->l,x{a,*b=l;a ?a+x*f[b,x]:0} Try it online

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

Answer
50%
+0 −0
Challenges Golf golf challenge

Python 3, 108 bytes lambda p,s:s<2and"Hole in one"or"Par:Bogey:Double bogey:Triple bogey:Albatross:Eagle:Birdie".split(':')[s-p] Try it online! Very similar to my other solution, but hand...

posted 3y ago by dino‭

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

Japt, 6 bytes -1 byte thanks to Shaggy! k ä¦ e Try it First time doing Japt so this is probably pretty bad. Just factorizes and checks that there are no duplicate factors.

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

Answer
50%
+0 −0
Challenges Generalized Sort

Ruby, 25 bytes Credits goes to @Shaggy and his JavaScript solution. ->a,l{l.map{a.sort! &_1}} Try this online! The other solution which not mutate original array

posted 3y ago by radarek‭

Answer