Code Golf
- codegolf.stackexchange.com Cyclically Sort a List
Given a list of Integers greater than zero, Sort each of the unique values in ascending order, then repeat the process on the remaining duplicate values and append. Example: [1,5,2,2,8,3,5,2,9] ==&...
Given a list of Integers greater than zero, Sort each of the unique values in ascending order, then repeat the process on the remaining duplicate values and append.
Example:
[1,5,2,2,8,3,5,2,9] ==> [1,2,3,5,8,9,2,5,2]
-
Sebastian Lague's Tiny Chess Bot Coding Challenge
YouTube Video
Click to view this content.
TL/DW: The contest is to submit a C# chess bot in which the code uses a maximum of 1024 tokens. (Every usage of a variable, value, function, and operator, counts as a token)
-
Challenge: Function that prints a
n
big treeWrite a function that prints an
n
big tree, e.g. for n=5:``` * * *
Here is what I came up with in C:
```c N,i;a(n){for(i=N=N?N:n+2;i--;printf(i?"* "+(N-n-1<i):--n?"\n":"\n%*s",N,"| |"));n&&a(n);}
// the invocation isn't part of the golf: main(){a(5);} ```
PS: Code blocks currently wrap around when they are too long, I've already submitted a patch to make them scroll horizontally instead.
-
-
International Obfuscated Python Code Competition
cross-posted from: https://programming.dev/post/24297
> u/msage's comment on another post made me remember seeing this a couple of days ago. > > ! > > From the site: > > This seems exactly like the IOCCC but for Python? > > > This contest is a complete rip-off the IOCCC idea and purpose and rules. If you like this contest, you will almost certainly love the IOCCC. Check it out!