Probably not allowed to say this, being an "open source" mod and all, but open source, for all the good things it has, is also full of nonsense. The variations in copyleft are stupid, too many permissive licenses, and you can't change anything without being yelled at.
"Fit Numbers"
Sam has a "brilliant" idea for compression! Can you help him?
Here is a rundown of Sam's compression scheme. First take in a base 10 representation of any natural number strictly smaller than 2^16, and write it as a binary string, and strip all leading zeros
1 -> 1
9 -> 1001
15...
PowerShell has hex "literals" -- the 0x operator. It's technically a unary operator that takes a hexadecimal string on the right and converts it to integer
code-golf string
Slowly turn a string into another
The Challenge
Given two strings/an array of strings, output the first string slowly shrinking and expanding back into the second string.
You can assume the strings will always start with the same letter.
Example
Input:
"Test", "Testing"
...
Reference Implementation in S.I.L.O.S "only" 417 bytes
Golfed
readIO :
i + 1
I = i
z = 1
n = 32
b = n
z = 1
n = b
lbla
n - 1
GOSUB p
j = i
j - p
if j b
if z c
z = 1
GOTO e
lblc
b - 1
if n a
GOTO f
lblb
z = 0
A = a
A + 1000
set A 1
i - p
lble
a + 1
if n a
lblf
q = 1000
e = q
e + b
i = 0
lbl>
d...
@Zizouz212 elemental halogens are bad, but if they are present in a nice stable compound its safe. Just like salt is ok, Sulfur Hexaflouride isn't toxic
@StevenH. Unfortunately, people have done that, but the annoying thing is that there's a sliding scale of quine-builtin-ness which makes it tricky to regulate
Are you tired of languages with built in quining techniques?
Your challenge, should you choose to accept it, is to add a built-in quine feature to the language of your choice.
Task
Given some programming language X, you should define
A language X′ that is a subset of X.
A quine command strin...
@Zizouz212 Umm, pretty sure that isn't true. Bleach and ammonia is bad, but I'm pretty sure the only thing bleach and baking soda does when mixed is clean stuff even better.
@Sp3000 Where I'd lie on the sliding scale is a function that gives the program (as a list of functions) as output; its primary purpose would be for self-modifying recursion, but you could easily extract the code used to create the program from that data (mapping a function-name grabber to the string, for example)
Say I'm trying to do codegolf.stackexchange.com/questions/89400/… in this programming language (assuming everything is implemented according to the current plan, which it's not). The solution could be /m\q; i.e. the intersection (/) of the program (q) mapped into their respective characters (m\ ).
The non-q solution would be almost the same as a lot of programs already posted as solutions: /"/\"\ but it has the benefit of mirror symmetry so that's cool I guess?
The second instance of \ in the string will autofill with another \ , then the " will autofill, then the input i will autofill; all three during the evaluation of the program itself rather than during preprocessing
@StevenH. But another reason for the sliding scale is languages like ><> which have a way of pushing almost all chars in the program in one byte, but more as a result of semantics of how the language works
If you find the right university, you might not need to worry about your age. I say might because I don't have experience with the Canadian system, but o'er in the US I was able to get into uni at 14 so it's definitely possible
@ASCII-only I know someone who's about two years younger than me yet we go to the same uni classes, so I think they joined a bit early. They don't get "exclusive rooms" for it though :P
@ASCII-only When I was in high school I was able to take lots of classes at the local community college for credit in both schools. I hadn't graduated early or anything, it was just a program. I agree that (unless your Terence Tao or w/e) what Steven describes is a rare situation (unless things have really changed)
It is rare as an organized program and even rarer as a single student going off fully matriculated to university, as there's only a handful of these types of programs in the world and (most) kids who want to go to university do it by just trying to excel in high school rather than running off to applications in their early (pre-)teens. It's just... it's possible