MacGyver's Second Toolbox

16

1

In this question each answer will get a "toolbox" that can be used to construct a program/function. The toolbox will consist of two things:

  • a list of programming languages

  • a list of valid characters

You must write a valid program/function in one of the languages provided using only the characters in the toolbox. Your program/function should output the number of answers already present on this question.

Once you have written and posted an answer the language and characters you have used will be removed from the toolbox and 1 new language and 8 new characters will be randomly added to be used as the toolbox for the next answer.

Rules

  • Each answer will:

    • Output the number of valid answers coming before it
    • Contain a subset of the characters provided in the toolbox for that answer. (repeats are allowed)
    • Be in one of the languages from the provided toolbox
  • The next toolbox will determined by this python program. To generate the next toolbox put in the remaining languages and characters along with the post id of the last answer.

  • The language list here is all the languages available on try it online at the time of this post. The characters have char codes 0-127.

  • You may write either a full program or a function as your answer. Since REPLs are different languages they will not be allowed. (use the TIO version of every language)

  • If a language uses a special encoding the characters should be interpreted as bytes (decoded from ASCII and padded with a zero).

  • The starting toolbox will be randomized from this questions post id (128464), there will be 7 languages to start and I will add the characters echoprint0 and ascii 0-31 for free to get people started.

  • You may not answer twice in a row

Scoring

Each time a person answers they will get a number of points for their answer. The goal is to get as many points as possible. For an answer in language X you will get as many turns as language X has gone unused in the toolbox. For example the first person to answer will get 1 point because the language was just added to the toolbox. There will not necessarily be an end and I will not be accepting any answers.

Sporting

This is a competition, but I encourage you to put fun above winning while still staying competitive (if I could make the winning criteria "fun had" I would). Some things that are not fun:

  • Intentionally using characters you don't need to stunt future answers.
  • Attempting to game the post id system to make future tool boxes harder to use.
  • Attempting to game the post id system to make future tool boxes easier to use.

I can't prevent any one from doing these things, but I will be downvoting any answers I suspect are doing this.

On a more positive note, here are some things that are good sporting and encouraged:

  • Coordinating with other users in chat.
  • Saving characters for harder or more restrictive languages

This is a second iteration of a challenge found here. It improves a number of problems with the first one. Here is a meta discussing these questions.

Post Rock Garf Hunter

Posted 2017-06-26T15:48:04.337

Reputation: 55 382

What's the first toolbox? – CalculatorFeline – 2017-06-26T15:55:28.987

@CalculatorFeline Its linked in the question, it is seeded with the question id. – Post Rock Garf Hunter – 2017-06-26T15:56:11.677

The python script is assuming an answer ID of 126443. – CalculatorFeline – 2017-06-26T16:02:23.700

Who is supposed to handle updating the toolbox? – CalculatorFeline – 2017-06-26T16:05:09.863

@CalculatorFeline You should post a link to the next toolbox in your answer. To avoid a storm of edits the question will not be updated. – Post Rock Garf Hunter – 2017-06-26T16:06:27.113

So I should remove everything I used from lines 2 and 3 and replace line 1 with 128470? – CalculatorFeline – 2017-06-26T16:07:48.123

@CalculatorFeline Yes, I've already done this one for you, but thats the correct method. – Post Rock Garf Hunter – 2017-06-26T16:09:05.700

@tuskiomi The previous question was very broken. I used data from it to make a better version. The differences are small but they are far from insignificant. Here's the meta about this question.

– Post Rock Garf Hunter – 2017-06-26T18:32:18.193

1@tuskiomi the older question and the newer question are created by the same person, and it is appropriate to close older questions as duplicates of newer, better questions. – Stephen – 2017-06-26T18:32:20.283

Oh. I think you should put the meta in your post. – tuskiomi – 2017-06-26T18:34:51.570

2@tuskiomi The biggest difference is the number of characters added to the sandbox each time. Previously it was 12, which quickly spiraled out of control, meaning that practically every answer had all of ASCII available to it. I've lowered it to 8, which was the average number of characters used by all the answers in the last version. I would agree that the difference in seed and scoring are minor changes, but the decrease in characters is the entire reason I've done a second iteration. – Post Rock Garf Hunter – 2017-06-26T18:36:29.977

@WheatWizard The answer-chain already looks kind of dead :/ – Mr. Xcoder – 2017-06-27T09:51:06.910

After a time, such as three days, without a new solution, adding another 8 chars might help the chain get un-stuck. You could seed it as the last post number, with an 'a' appended to the end, and then 'b' the next three days if it is still stuck. Just an idea. – Grant Davis – 2017-07-31T16:28:40.153

Is this challenge even possible? – pppery – 2017-08-05T00:56:16.267

@ppperry I'm not sure it is at this point. I will add more letters to the box when I get the chance. – Post Rock Garf Hunter – 2017-08-05T00:56:55.523

@WheatWizard Did you ever get around to doing that? – pppery – 2017-08-18T11:49:02.203

In the current toolbox, what language is "str"? – pppery – 2018-08-02T23:24:26.647

@ppperry Each language is given by its TIO identifier. https://github.com/ConorOBrien-Foxx/str

– Post Rock Garf Hunter – 2018-08-02T23:26:14.110

1I'm pretty sure this is impossible. Str programs require a ; (not in toolbox) to do anything when given no input. Condit and Tcl programs require a space (not in toobox) as part of the syntax. Scheme needs (. Brain-Flak can't work for obvious reasons (only character in toolbox it understands is )). Java 8 needs a { (not in toolbox) to declare a function. That leaves only maxima, which I don't think can print things without "print" or declare a function without the use of parentheses. – pppery – 2018-08-03T00:54:54.343

The above comment isn't quite correct, because I forgot about the -> syntax for Java functions, however that isn't in the toolbox either. Doesn't make it possible ... – pppery – 2018-08-03T01:16:55.367

@ppperry Wish I'd seen your comment before spending an hour trying to continue this, muddling through undocumented/weirdly documented features, and coming to the same conclusion. Unfortunate that half the languages ended up being mainstream languages that require elaborate syntax, and none of the other half use a code page that could make use of the ASCII 0-31 bytes. – sundar - Reinstate Monica – 2018-08-07T13:18:02.357

Answers

8

This is impossible

Going through all of the languages in the langbox:

  1. The tcl programming language consists of words separated by spaces. The space character is not in the toolbox, so no valid programs can be written.
  2. Str programs by default transform input. In order for them to do anything when given no input, the ; character is required, which is not in the toolbox.
  3. The only means for a program in scheme-chez to do anything is by calling a function using parentheses. All scheme-chez programs therefore need the ( character, which is not in the toolbox
  4. Brain-Flak programs need balanced brackets. The only bracket character in the toolbox is ), so no programs containing balanced brackets are possible.
  5. Similar to scheme, maxima programs require parentheses to do anything.
  6. Java programs require the { or -> character sequences to declare a function (and all full programs need at least one function), none of which are in the toolbox.
  7. Condit programs require the word when, which contains the "e" character, which is not in the toolbox.

Proofs of impossibility are allowed as answers

pppery

Posted 2017-06-26T15:48:04.337

Reputation: 3 987

4

Business Cat

Posted 2017-06-26T15:48:04.337

Reputation: 8 927

3

1. Bash, outputs 0

echo	0

Try it online!

The code contains a literal tab.

Next toolbox

CalculatorFeline

Posted 2017-06-26T15:48:04.337

Reputation: 2 608

Oh :( That's too bad. – CalculatorFeline – 2017-06-26T16:02:52.583

3Update: This is valid once again :D – CalculatorFeline – 2017-06-26T16:03:53.917