Search
C is a language I use most apart from Python and as someone who likes code golf challenges, what tips are there to golf in C?
The Rules In this game, each round, every player faces off against every other player in a round robin format. In each match, players pick 3 positive integers that sum to 360. Let's say player 1 p...
MoshiBot from numpy.polynomial import Polynomial def MoshiBot(data, history): if len(history) < 10: return [180, 180, 0] lastmin = min(history[-1]) lastmid = sorted(history[-1])[1] ...
COPS THREAD A famous cops-and-robbers challenge whose source shall remain unnamed is brought to Codidact. You are a robber. Your goal is to find answers on this link which haven't been cracked an...
Japt, 6 3 bytes Cut in half thanks to Shaggy! ¬v1 Try it online! Golfed thanks to Shaggy's interpreter auto-golf feature. ¬v1 ¬ //Square root v1 //Is that an integer?
Prolog (SWI), 42 bytes R-S:-S is R*R;R<S,M is R+1,M-S. f(S):-0-S. Try it online!
C or C++ (gcc) 220 bytes, cracked by Razetime %: %: define cops(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) if(not false and k%:%:f%:%:d%:%:l(& (not true) <:%:i%:j%:k%:l" "%:m" "%:n%:o%:p%:...
Python 2, 61 bytes i=12;exec"print'YWUSQOMKIGECABDFHJLNPRTVXZ'[i:14+i];i-=1;"*13 Try it online! I tried to do it without writing the full list 'YWUSQOMKIGECABDFHJLNPRTVXZ' but couldn't get l...
Turing Machine.io, 363 bytes 0 0 0 0 -1 8 0 0 8 4 0 1 9 0 0 9 -1 0 0 1 0 0 1 0 0 1 9 0 1 1 1 0 1 9 0 2 1 2 0 1 9 0 3 1 0 0 -1 2 0 2 2 2 0 -1 3 0 0 3 0 0 -1 3 0 1 3 1 0 -1 3 0 2 3 2 0 1 4...
Jelly, 13 bytes ØAUƤz⁶ZUŒBŒḄY Try it online! How it works ØAUƤz⁶ZUŒBŒḄY - Main link. Takes no arguments ØA - Yield the uppercase alphabet Ƥ - Over each prefix: U ...
Jelly, 8 bytes ṖUs2UṭµF Try it online! -1 byte thanks to caird coinheringaahing (Also posted on Stack Exchange by myself) ṖUs2UṭµF Main Link Ṗ pop (remove last element; for numbe...
BQN, 8 bytesSBCS ⍒↕+2|⊢+↕ Run online! The solution itself is an 8-train, so its evaluation order is given by the sequence 7 5 6 3 4 1 2 0: first the rightmost ↕, then the ⊢, then the + between...
Jelly, 3 bytes Ḷ߀ Try it online!
I have this challenge in Code Golf and I wonder if I can repost it here for more users to come, and also continue making these since I actually like them. Can I post this challenge to Codidact?
Jelly, 6 bytes _ÆṣṠ)Ġ Try it online! In order of abundant, perfect, deficient. _ÆṣṠ)Ġ Main Link ) For each from 1 to N _ Subtract Æṣ The proper divisor sum Ṡ Sign ...
BQN, 21 bytesSBCS (¬·×-+´·/0=↕⊸|)¨⊸⊔1+↕ Run online! Mostly one big train used to find the appropriate group for each number, to be used with Group (⊔). The combining functions in a train norma...
Vyxal C, 8 bytes kA¦ømƛøm Try it Online! Explanation: kA # Push the alphabet ¦ # Prefixes øm # Palindromize list without duplicating middle ƛ # For each: ...
Japt -R, 16 15 14 bytes pÔ¬Ëú°EDùEÃÆpÔ Try it pÔ¬Ëú°EDùEÃÆpÔ :Implicit input of string p :Append Ô : Reverse ¬ :Split Ë ...
What tips are there in fastest code, or what I like to call code speeding, challenges in Python?
Haskell, 50 bytes [take 9$drop i$cycle[1..9]|i<-[0,3,6,1,4,7,2,5,8]] Try it online!
Seems to be an issue with the ordering (across languages) when "Group by language" is set. When I first load the page, they are ordered with the most recent post first. If I then uncheck "Group by ...