my solution creates a range 1 to the length of the string, then selects those numbers in the range that are not divisible by the number and takes those from the string
@JanDvorak wait I think every command is a char instead. 1114112 commands can be named this way and of course there's always a way to type them, as well as aliases
(s)ed - 6 bytes
1-based indexing.
s/.//n
Explanation:
s # substitute command.
/./ # match any single char.
// # substitution is empty.
n # Only match the 'n'th occurrence in a line.
@KritixiLithos I don't think it's valid, as you're only allowed to take input via modification to the code if the language can't take any other form of input.
Haskell, 100 bytes, score ≈ 10↑↑65503
f!x|x<' '=f|q<-(!pred x),r<-(q$q f)[x]=foldl(.)f[f|_<-r,_<-r]
main=print$(\x->x++x)!'�'$[pred ':']
The special character (2^16 - 3 ascii) counts as 2 bytes. pred ':' is equal to '9'.
@feersum 1) It's extremely difficult (nearly impossible) to trash messages from mobile and 2) IMO two faces isn't bad enough to warrant trashing/kicking. That's just my personal opinion though, I'm not sure what the other ROs would say
If it went on longer I would have trashed it though
Given text, remove leading and trailing whitespace (spaces, tabs, and newlines).
Alternate title: Implement your own string trimming.
Input
ASCII text (printable + spaces, tabs (\t), and newlines (\n)), in whatever format you would like. Carriage returns (\r) are outside of the scope of the in...
We all love xkcd comics, right? So let's get some!
Task
Your task is to create a program that will take an integer and output the corresponding xkcd comic. The correct comic is the one that has a matching number in its permalink:
https://xkcd.com/<input number>
This is where it gets tricky. ...
Task
When running the program must show the season according to the host computer's current time.
Rules
The output must be either: Spring, Winter, Summer or Autumn.
The capitalization does not matter.
The output must not contain anything else the the season names stated above.
A season is 3 m...
This is a cake:
_========_
| |
+________+
| |
+________+
| |
+________+
It is 8 wide, 3 tall, and 1 deep.
You must write a program that makes a cake from 3 inputs. The first input controls how many underscores there are in the middle and =s on the top. Here's the first ca...
How many times?
code-golfstring
Inspired by Rotational symmetry of string.
Given a string, return its shortest substring that, when repeated a number of times, will produce the original string, as well as the number itself.
Test cases:
"ABCDABCDABCDABCD" => "ABCD", 4
"AAAAAAAAAA" => "A", 10
...
Task: Given the area of a triangle, find a Heronian triangle with that area. Any Heronian triangle with the specified area is allowed.
A Heronian triangle is a triangle with integer sides and integer area.
If no such triangle exists, output with a consistent falsey value.
Input: A single, posi...
There's no place like home
I recently watched The Wizard Of Oz and thought that when Dorothy taps her shoes together three times, it would be easier if she used a program to do it. So let's help her.
Task
Output slippers being tapped together n times.
Input
A single integer, n, the number of...
A convenient and useful way to represent topological surfaces is with a fundamental polygon. Each side on a polygon matches to another side and can be either parallel or anti-parallel. For instance the here is the fundamental polygon of a torus:
To figure out why this is a torus we could i...