31
10
A lot of PPCG users helped with the creation of this challenge, both in chat and the Sandbox, specifically Martin Ender, AdmBorkBork, Emigna and user202729
Our community has found it necessary to create a set of languages designed specifically for golfing, "golfing languages" as we call them. Such languages have evolved from the once brilliant, now clunky GolfScript to the sleek concise languages such as Jelly and Husk. As we can see, these languages are continually getting shorter and shorter for a set of tasks. So, as the obvious experts around here regarding golfing languages, we should design a language together to beat every other language that dares to compete. Introducing Bugle!
Bugle: From the acronym BuGoL: Built Golfing Language.
How this challenge will work
In case you didn't get what I'm alluding to in the introduction, this challenge is an answer-chaining challenge where we each contribute something to the interpreter of a new golfing language, improving its ability to compete on PPCG with each answer.
I will post the first answer consisting of the basis of the language spec/interpreter, and all other answers will continue from that. New submissions will provide the following things:
- A change to the language's spec
- An up-to-date interpreter, meeting exactly what is laid out in the changes
- The language's updated score (more details in a bit)
You may change the spec in one of three ways:
- You may add a single command
- You may add two new commands
- You may edit the behaviour of one existing command
Regarding the new interpreter, you must use the latest version, written in Python. It does not have to be golfed. Every previously added command must be testable with the latest interpreter, as well as the newest command(s) (the one you add). You must also not use offensive language at any point when updating the interpreter, such as in comments or string literals etc.
The added command(s) may do anything you wish. The only requirements are:
- It doesn't produce offensive output
- It isn't the same as another command
- It doesn't prevent one of the sample challenges from being completed
Aside from these, it can be as specific or as general as you want. It can also be any character you want. If you aren't sure if your addition constitutes a 'new command', feel free to ask in the comments.
The language's score
You may have noticed that you have to include the language's score in all new submissions. Its score is what prevents this challenge going forever, and is defined as follows:
The current score is the sum of the byte counts it takes for the language to complete the below 20 tasks
For each of the tasks, Standard I/O rules apply, as do the standard loopholes.
The 20 tasks:
- "Hello, World!" – Output the string
Hello, World!
- 1, 2, Fizz, 4, Buzz – Output each integer from 1 to 100 (inclusive) on a separate line, with multiples of 3 being replaced by
Fizz
, multiples of 5 being replaced byBuzz
and multiples of both byFizzBuzz
- Produce the number 2014 without any numbers in your source code – Output the number 2014 without using any of the characters
0123456789
in the source code, without accessing external variables or random seeds - Obfuscated Hello World – Output the string
Hello, World!
, without using any of characters in at least two of the following sets:hlwd
,eor01
and27
(case-insensitive) Sing Happy Birthday to your favourite programming language – In a language of your choice, output the following:
Happy Birthday to You Happy Birthday to You Happy Birthday Dear [the name of your favourite programming language] Happy Birthday to You
We're no strangers to code golf, you know the rules, and so do I – Output the full lyrics of "Never Gonna Give You Up"
- Output the sign – Given a number, print -1 if it is negative, 0 if it is 0 or 1 if it is positive
- Collatz Conjecture (OEIS A006577) – Starting from an integer, divide it by 2 if it's even, or multiply it by 3 and add 1 if it's odd, and repeat the process until you reach 1. The output should be the number of iterations it takes you to reach 1.
- An Array of Challenges #1: Alternating Arrays – Given an array of integers, check whether all even-indexed items are equal, and all odd-indexed items are equal, and output a truthy or falsy value accordingly
- Am I an insignificant array? – Given an array of integers, check whether the absolute differences between consecutive elements are all smaller than or equal to 1, and output a truthy or falsy value accordingly
- Is this number a prime? – Given a positive integer, write a full program to check whether it is prime, and output a truthy or falsy value accordingly
- I'm a palindrome. Are you? – Given a string, check whether it is palindrome, while your program / function is palindrome too, and output two distinct and consistent values accordingly
- Sum the numbers on standard in - Take a series of numbers in from STDIN and output their sum.
- Find the Factorial - Given an integer
n
, output the product of all integers between1
andn
inclusive. - Shortest code to produce infinite output - Without any input, produce infinite output, that will, theoretically, never stop outputting.
- Bake a slice of Pi - Output this exact text:
()()()()()()
|\3.1415926|
|:\53589793|
\::\2384626|
\::\433832|
\::\79502|
\::\8841|
\::\971|
\::\69|
\::\3|
\__\|
- Find the smallest number that doesn't divide N - Given a positive integer N, output the smallest positive integer that does not divide N.
- Is this even or odd? - Given an integer N, output its parity as truthy/falsy values.
- Output with the same length as the code - Write the shortest code whose output has the same length as the code, where the output is not the same as the code.
- Golf you a quine for great good! - Write the shortest quine in your language.
In order to be valid, a new submission must have golfed submissions for at least 2 of the problems, by at least 1 byte for each. You may increase the lengths of other submissions, but the total score must decrease by at least 2 per answer. Also, please consider including a link to the updated programs. The updated solutions must not work when run with a previous version of the interpreter.
How to get cookies
I have a list of 5 challenges, which aren't compulsory to attempt, and have no bearing on your score, but are simply additional challenges to test if Bugle is capable enough. Feel free to include a solution to any number of these in your answer:
- Create a Self interpreter
- Create a payload capable quine
- Covfefify a string
- Hyperprogramming: N+N, N×N, N^N all in one
- "KNOT" or "NOT"?
Descriptions not included as they aren't required for everyone to be able to compete in the challenge.
How to win
Once the minimum score (we believe to be 16, although any attempts to golf that down are much welcomed) has been reached, obviously the chain has ended as solutions cannot get a better score. Once 16 has been reached, the challenge stays alive for 1 month afterwards, to give anyone a chance to golf the solutions any more. After this month has passed, the challenge is over.
Once the challenge is over, I will be migrating the interpreter onto a GitHub repository, and going through the usual machinations of releasing a stable language. You may also begin to post solutions to challenges on PPCG at this time, using the said language, but please try not to flood the front page with answers. Instead, spread them out over a period of time.
Formatting
In order to make information easier to find in your answer, please format it as follows:
# [N]. [Score]
[New command + description]
[Interpreter/link to interpreter]
[Link to programs]
Where [N]
is your answer number (1 for the first, 2 for the second etc.)
Rules
- You must wait 3 hours between posting answers
- You may not post twice in a row, unless no answer has been posted for 10 days (exactly 240 hours)
- You may not remove previous commands.
- Your interpreter doesn't have to be golfed, and its byte count is completely irrelevant here.
- If someone suggests a golf to the programs while your answer is the latest, you must edit in the golfs, and update your score.
- You may also do this when your answer is in the middle of the chain, so long as your score doesn't become lower than any later answers.
- Please refrain from answering any existing PPCG challenges using this language, at least until the challenge is over
- The interpreter is written in Python 3, and should continue that way throughout the entire chain. Changing the language is forbidden.
- Again, in order to be valid, a new submission must have golfed submissions for at least 2 of the problems, by at least 1 byte for each.
Let's get started!
1Sandbox – caird coinheringaahing – 2018-04-13T09:22:29.877
1Might as well ask: Anyone like to explain the downvote? I'd value any and all feedback you'd like to give. – caird coinheringaahing – 2018-04-13T09:40:23.430
Wouldn't the minimum score be 20 (1 built-in per challenge) ? – Kaldo – 2018-04-13T09:47:02.873
2@Kaldo We're not quite sure. The quine has to be two bytes minimum, but if the empty program outputs
Hello, World!
, then it's 19 bytes. But if the behaviour of the empty program changes, dependant on the input, it may be able to be reduced – caird coinheringaahing – 2018-04-13T09:48:33.437And it'll probably get soft-locked before it gets to the possible minimum – Jo King – 2018-04-13T09:51:00.113
Should challenge 3 and 4 be measured in bytes or characters? – user202729 – 2018-04-14T04:12:24.257
Can we post Bugle answers to other challenges on this site? – Weijun Zhou – 2018-04-14T08:04:16.207
@user202729 They should all be measured in bytes when encoded in the Bugle encoding. – caird coinheringaahing – 2018-04-14T10:08:51.313
I meant "scored". For example if
H
is bannedĭ
should be banned too as it's[BEL]H
. – user202729 – 2018-04-14T10:09:57.2571@WeijunZhou "Please refrain from answering any existing PPCG challenges using this language, at least until the challenge is over" – caird coinheringaahing – 2018-04-14T10:10:09.977
@user202729 If a challenge, such as "Output 2014" bans certain characters, than it's those characters that are banned, not characters which have the same ordinal in their encoding. – caird coinheringaahing – 2018-04-14T10:17:06.207
Can we strictly only add new commands, or can we also introduce new syntax constructs and the like? (note how I say "new", these obviously wouldn't upturn the language's existing syntax) – LyricLy – 2018-04-14T10:59:25.050
1@LyricLy Syntax constructs (such as
for
loops) are allowed, and encouraged to be added – caird coinheringaahing – 2018-04-14T12:00:18.253