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 »

Activity for General Sebast1an‭

Type On... Excerpt Status Date
Answer A: 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 binary is not enough, we can also have code of certain languages for some diversity. What's more cool ...
(more)
over 2 years ago
Answer A: Digit Sum Integer Sequence (working title)
[Python 3], 183 181 175 bytes def f(a,b): &#9;c=a;a=str(a) &#9;for i in range(b): &#9;&#9;y=0;z=9 &#9;&#9;for j in range(len(a)): &#9;&#9;&#9;if y&lt;int(a[j]):y=int(a[j]) &#9;&#9;&#9;if z&gt;int(a[j]):z=int(a[j]) &#9;&#9;c=int(a)+y+z;a=str(c) &#9;print(c) Try it online! I deci...
(more)
over 2 years ago
Answer A: Tips for golfing in Python
Assign `float`s while leaving out zeroes Python allows such strange assignment. You can save bytes by removing the number preceding `.` if it's only `0`: i=.5 print(i) Try it online! The same goes for succeeding digits, if the decimal part of the `float` is `0`: ...
(more)
over 2 years ago
Answer A: Reverse an ASCII string
[Lua], 32 bytes print(string.reverse(io.read())) Try it online! Noice built-in.
(more)
over 2 years ago
Answer A: Getting perfect squares, differently
[Lua], 41 40 bytes x=0 y=1while""do print(x)x=x+y y=y+2 end Try it online!
(more)
over 2 years ago
Answer A: A number adder, not a death adder
[Lua], 51 bytes P1: print("print(tonumber(io.read())+"..io.read()..")") Try it online! P2 (given I inputted 10, 29 bytes): print(tonumber(io.read())+10) Try it online!
(more)
over 2 years ago
Answer A: Tips for golfing in Python
Renaming functions A funny, cool, and useful trick. If you have to write a single function multiple times (usually `range()` on `for` loops), then you can simply assign a variable by the function's name, no parentheses. An example assignment is: ``` r=range ``` Thing is, this can only appl...
(more)
over 2 years ago
Answer A: Tips in golfing using Lua
Convenient whitespace removal Here are instances where you can remove whitespace: Strings If you assigned or printed a string, then the next supposed line of code can lean on the right double-quote: --[[ name = "Mark" print(name) ]] name="Mark"print(name) Tr...
(more)
over 2 years ago
Answer A: Diagonalized alphabet
[C (clang)], 206 bytes main(i){chars="YWUSQOMKIGECABDFHJLNPRTVXZ";for(i=13;i>0;printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",s[-1+i],s[0+i],s[1+i],s[2+i],s[3+i],s[4+i],s[5+i],s[6+i],s[7+i],s[8+i],s[9+i],s[10+i],s[11+i],s[12+i]),i--);} Try it online! yez ai m gud progamer!11!
(more)
over 2 years ago
Question Suggestions for the new header banner/background
I'm bored. Let's do something. lmao While I was Somewhere Else, I went to make suggestions for designs on their sites, and no impact really occured. However, since I'm now a Codidactian (not a Codidactyl, sorry), I want to start doing the same here. And let's start off with the upcoming site desig...
(more)
over 2 years ago
Article Collatz conjecture; Count the tries to reach $1$ [released]
Background Check out this video on the Collatz conjecture, also known as A006577[^1]. If you don't know what this is, we're given an equation of $3x + 1$, and it is applied this way: - If $x$ is odd, then $3x + 1$. - If $x$ is even, then $\frac{x}{2}$. This will send us in a loop of `4 →...
(more)
over 2 years ago
Answer A: Tips for golfing in Python
Use `lambda`s instead of functions At most times, `lambda`s tend to make smaller code, which is helpful in golfing. Assigning a `lambda` is easy, just do: ``` lambda f:whatever ``` There are many answers that uses this strategy (I don't use it). Here are some examples: - Make $2 + 2 = 5$ ...
(more)
over 2 years ago
Article Draw shapes: E1 - Square/Rectangle
Challenge Take input of a non-whitespace character and a positive integer $n$, and print out a square (or rectangle) of size $n$ using the inputted character. Shortest program wins! Test Cases ```none n = 1, c = $ $$$ $ $ $$$ n = 3, c = ^ ^^^^^ ^ ^ ^ ^ ^ ^ ^^^^^ n = 10, ...
(more)
over 2 years ago
Answer A: Tips for golfing in Python
`import` You can import some libraries and if you find yourself using: ``` from lib import ``` Remove the space between `import` and ``, because it works for whatever reason.
(more)
over 2 years ago
Answer A: Tips for golfing in Python
Combine conditionals Python has its fair share of comparison operators and can actually be used in a single conditional. For example: ``` x == 2 and y == 2 ``` can be: ``` x==y==2 ``` Used on Make $2 + 2 = 5$. @celtschk also mentions that different operators can also enter a single ...
(more)
over 2 years ago
Answer A: Tips for golfing in Python
Replace `for` loops with string multiplication Let's say we have: for i in range(6):print(end="#") Try it online! This basically outputs `#` 6 times, which is self-explanatory in the code itself. Perhaps we can shorten it with string multiplication: print(end="#"6) Tr...
(more)
over 2 years ago
Answer A: "Hello, World!"
[jq] `--null-input` `--raw-output`, 15 bytes "Hello, World!" Try it online! They kept saying that [jq] is the language of September 2021. Still surprised no one even made a `Hello, World!` on it.
(more)
over 2 years ago
Question Stairs? Stairs! Stairs.
Challenge - Make a program that takes input of an integer that's $n > 1$ and print out a staircase using a specific character for stair basing (hashes (`#`) for demonstration; you can use spaces, but not tabs or other whitespace characters), slashes (`/`), and underscores (``). - The basis of the...
(more)
over 2 years ago
Answer A: "Hello, World!"
[SQLite], 21 bytes select'Hello, World!' Try it online!
(more)
over 2 years ago
Answer A: "Hello, World!"
[Emoji], 24 bytes 💬Hello, World!💬➡ Try it online!
(more)
over 2 years ago
Answer A: Tips in golfing using Lua
Remove `print`'s parentheses when it's a single string `print` strangely works without parentheses, however, it only applies to single strings. In other words, it can't do the same for other variables or string concatenation inside the function. For example: ```lua print("Hello, World!") ```...
(more)
over 2 years ago
Answer A: Coat of Many Colours
[Python 3], 349 261 160 bytes a="re y gree br sc bla oc pe rub ol v f li go ch m cre cri si ro a le rus grey pu w pi or blu".split() def f(b):return[j for i in a for j in b if j[:len(i)]==i] Try it online! Golfed 88 bytes thanks to @user's advice. Golfed 81 bytes thanks to @celt...
(more)
over 2 years ago
Answer A: My house is destroyed! Can you make me one?
[C (clang)], 116 102 bytes j,k;f(i){for(j=i;j--;printf("#"));for(j=i-1;j--;printf("#"))for(k=i-2,printf("\n#");k--;printf(" "));} Try it online! Sometimes, it's better to use functions when you're not restricted from using it. Golfed 14 bytes thanks to @Moshi's advice.
(more)
over 2 years ago
Article Output 1 to 1000 without built-in loops [cancelled]
Challenge Create a program that outputs $1$ to $1000$, but, you can't use `for`, `while` and loops of the like. Shortest program wins!
(more)
over 2 years ago
Answer A: 1, 2, Fizz, 4, Buzz!
[Lua], 126 118 bytes p=print for i=1,100 do if i%15==0 then p"FizzBuzz"elseif i%3==0 then p"Fizz"elseif i%5==0 then p"Buzz"else p(i)end end Try it online!
(more)
over 2 years ago
Answer A: Word Set Square
[Python 3], 196 195 145 102 91 89 87 79 bytes x=input();x+=x[::-1];i=-1 for c in x[:-1]:print(c(i>-1)+" "i+c);i+=1 print(x) Try it online! Golfed 50 bytes thanks to @celtschk's advice. Golfed another 43 bytes thanks to @celtschk's advice. Golfed another 11 bytes thanks to @...
(more)
over 2 years ago
Answer A: "Hello, {name}!"
[Ruby], 24 21 18 bytes p"Hello, #{gets}!" Try it online! Golfed down 3 bytes thanks to @snail's advice. Golfed down 3 bytes thanks to @south's advice.
(more)
over 2 years ago
Answer A: "Hello, {name}!"
[Java (JDK)], 134 123 118 bytes interface M{static void main(String[]a){System.out.print("Hello, "+new java.util.Scanner(System.in).nextLine()+"!");}} Try it online! Golfed 5 bytes thanks to @user's advice.
(more)
over 2 years ago
Answer A: "Hello, {name}!"
[Lua], 35 32 bytes print("Hello, "..io.read().."!") Try it online! Golfed 3 bytes thanks to @Moshi's advice.
(more)
over 2 years ago
Answer A: "Hello, {name}!"
[Python 3], 27 bytes print(f"Hello, {input()}!") Try it online!
(more)
over 2 years ago
Question "Hello, {name}!"
Background While we do have a "Hello, World!" challenge, we still don't have one regarding input. So let's do one! Challenge Create a program that takes an input (not as a function argument) then outputs `Hello, `, the variable and `!` altogether. Standard I/O only applies. Shortest submissi...
(more)
over 2 years ago
Article Define a mathematical expression in English [released]
Background Inspired by this challenge that is also a mathematical English translator. Challenge Write a program that translates a mathematical expression using English with the following specifications: - The expression can only take in numbers, letters from the English alphabet, the equa...
(more)
over 2 years ago
Question Can we have [popularity-contest]s?
Just curious, but this might help other users, so I'm placing at Meta. A popularity-contest is a non-object winning criteria challenge that is based on having the highest scored answer of the challenge. Basically, you can do the specific tasks in any way, and make the program a little something to...
(more)
over 2 years ago
Question Separate the tags away from the Sandbox or delete the [finalized] tag
> This is a feature-request post consisting of 2 actions for a reason... There's this thing that's been bugging me for a while in Code Golf CD. If you go to the tag page of the Challenges category, you'll be greeted with, of course, tags. But there's one tag that I didn't want to see a part of in ...
(more)
over 2 years ago
Article Stairs? Stairs! Stairs. [released]
Challenge - Make a program that takes input of an integer that's $n > 1$ and print out a staircase using a specific character for stair basing (hashes (`#`) for demonstration; you can use spaces, but not tabs or other whitespace characters), slashes (`/`), and underscores (``). - The basis of the...
(more)
over 2 years ago
Question Make my value binary
Challenge What do computers understand? That's right, binary. All files are turned into binary digits when you run them, but what if I suggest giving you an `int` then turn it into it's binary value. - Take input of a non-negative decimal integer and output its binary value/form. - Any precedi...
(more)
over 2 years ago
Article Abbreviate everything [released]
Challenge Make a program that takes input of a string and abbreviate it. - All letters of an abbreviation are capitalized, so keep that in mind. - Whitespace, numbers and non-English characters are ignored. - If the inputted string is a paragraph (2+ sentences), the abbreviation will be split...
(more)
over 2 years ago
Question Tips in golfing using Lua
Lua's not really used much in golfing, so it'd be pretty cool to learn some golfing tricks when making answers using it. What golfing tips are there for Lua?
(more)
over 2 years ago
Question Make $2 + 2 = 5$
In this challenge, add 2 integers, but if both the integers are `2`, output `5`. Shortest code in each language wins! Example ungolfed program in [Python 3.x] def add(x, y): &#9;if x == 2 and y == 2: &#9;&#9;return 5 &#9;else: &#9;&#9;return x + y Try it online!
(more)
over 2 years ago
Question My house is destroyed! Can you make me one?
Background A House of I I went on an adventure Grabbed resources and making deeds Like start to work on the materials To build the shelter I need It was a marvelous one At least in the eyes of mine And when the sun sets I go inside I went to sleep in comfort Hoping to...
(more)
over 2 years ago
Article Speedrunning "Big Iron" [cancelled]
Background The inspiration of this challenge came from this video. The premise was to speedrun the song while still keeping the story intact. In the video, the lyrics go: ```none To the town Rode a ranger Had a big iron on his hip He came to kill an outlaw by the name of Texas Red Swift rang...
(more)
over 2 years ago
Answer A: In The Jailhouse Now
[C (clang)], 210 198 183 bytes i,j,k,l;s(v,w,x,y,z){printf("%s",v);for(;w<x;w++){printf("%s",y);}puts(z);}main(){scanf("%i",&i);l=i-3;s("╔",j,l,"╦","╗");for(j=0;j<i-2;j++){s("╠",k,l,"╬","╣");}s("╚",j=0,l,"╩","╝");} Try it online! Still wondering if these characters could even count a...
(more)
over 2 years ago
Article Make my value binary [released]
Challenge What do computers understand? That's right, binary. All files are turned into binary digits when you run them, but what if I suggest giving you an `int` then turn it into it's binary value. - Take input of a non-negative decimal integer and output its binary value/form. - Any precedi...
(more)
over 2 years ago
Article My house is destroyed! Can you make me one? [released]
Background I went on an adventure Grabbed resources and making deeds Like start to work on the materials To build the shelter I need It was a marvelous one At least in the eyes of mine And when the sun sets I go inside I went to sleep in comfort Hoping to show it to comr...
(more)
over 2 years ago
Answer A: Generate Lewis Caroll's Jabberwocky
[Python 3], 874 bytes a="'Twas brillig, and the slithy toves\nDid gyre and gimble in the wabe;\nAll mimsy were the borogoves,\nAnd the mome raths outgrabe.";b="he Jabberwock";c="Beware t";d="One, two!";e="nd through";f="\n\n";g="vorpal" print(a+"\n\n\""+c+b+", my son!\nThe jaws that b...
(more)
over 2 years ago
Answer A: Evaluate a single variable polynomial equation
[Python 3], 167 127 118 117 94 63 bytes def f(a,b): &#9;y=0 &#9;for z in range(len(a)):y+=a[z]bz &#9;print(y) Try it online! Close gap to @user's `lambda` answer! Golfed 40 bytes thanks to @user's advice. Golfed another 9 bytes thanks to @user's advice.
(more)
over 2 years ago
Answer A: Small integer swapping
[C (clang)], 63 bytes x,y;main(){scanf("%i%i",&x,&y);printf("%i %i\n%i %i",x,y,y,x);} Try it online!
(more)
over 2 years ago
Question Remove flags on the leaderboard
I'm still being bugged by flags being ignored when adding the language onto the leaderboard. Take for example here on an answer in Vyxal: ... In case you don't know, when we write an answer, using flags will add them as `code` beside the language name, and I don't think it's necessary to have f...
(more)
over 2 years ago
Question Small integer swapping
In this simple challenge, create a short program that takes 2 `int`s as input, output them, swap their places, then output them again. Those 2 integers can't be the same number. The program with the shortest solution wins! Loopholes are banned in this challenge. An example C program for the challe...
(more)
over 2 years ago
Article Golf the MarkFuncs program [cancelled]
Introduction I wrote a Python program where it basically takes input of a string then something else if it's necessary, then it will solve a specific challenge, kinda like HQ9+. The program lies on a GitHub repo named MarkFuncs as the proglang's name if it even would exist. As of the posting of...
(more)
over 2 years ago