24
\$\begingroup\$

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 12 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 (126063), 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 person will have a score equal to the number valid answers they have provided. 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
\$\endgroup\$
15
  • \$\begingroup\$ Can we output numbers in bases other in 10? \$\endgroup\$
    – sporkl
    Commented Jun 13, 2017 at 14:09
  • \$\begingroup\$ @ComradeSparklePony If that is the standard way of outputting in a language. \$\endgroup\$
    – Wheat Wizard
    Commented Jun 13, 2017 at 14:10
  • 3
    \$\begingroup\$ Well...an interesting setup that got nipped in the bud early due to too many missing characters for languages that are defined by a very small set of characters. Logicode got hosed by the lack of a 1 and ! in its toolbox. I managed to produce the string "0110" using ?,0 and + although I couldn't quite figure out what the ? actually did (and it was not in the language specification). But + was missing from the toolbox as well, along with = which would have allowed for variable assignment. Aaanndd...no o for output. \$\endgroup\$ Commented Jun 13, 2017 at 17:34
  • 1
    \$\begingroup\$ @Draco18s I found an SML answer, so maybe now there are enough chars available for a logicode answer. \$\endgroup\$
    – Laikoni
    Commented Jun 14, 2017 at 10:46
  • 1
    \$\begingroup\$ Adding 12 new characters each time may have made this too easy. \$\endgroup\$
    – mbomb007
    Commented Jun 16, 2017 at 15:53

56 Answers 56

1
2
1
\$\begingroup\$

38. Go, 20 bytes

First 20 byte Go solution on PPCG..? :P

func()int{return 37}

Try it online!

Next toolbox.

\$\endgroup\$
1
\$\begingroup\$

39. wsf, 58 bytes

          
  
                    	  	
	 
  		          		

Try it online!

Next toolbox

\$\endgroup\$
1
\$\begingroup\$

43. Logicode, 19 bytes

out @110100+@110010

Try it online!

Next toolbox

\$\endgroup\$
6
  • \$\begingroup\$ I didn't know that Logicode could output anything other than 1 and 0, I thought we were going to have to wait until 100. \$\endgroup\$
    – Wheat Wizard
    Commented Jun 16, 2017 at 13:17
  • \$\begingroup\$ @WheatWizard: Yeah, at a first glance I was thinking the same but discovered that it could :) \$\endgroup\$
    – Emigna
    Commented Jun 16, 2017 at 13:18
  • \$\begingroup\$ Well brainbool got added an it can't output anything other than 1 and 0 for sure. So it looks like we are going to have to wait on that one. \$\endgroup\$
    – Wheat Wizard
    Commented Jun 16, 2017 at 13:19
  • \$\begingroup\$ @WheatWizard surely brainbool could output the correct number in base2? You said in the comments of the OP that outputting in a base other than 10 is acceptible if it's the standard way of outputting in that language \$\endgroup\$
    – Mayube
    Commented Jun 16, 2017 at 13:26
  • 1
    \$\begingroup\$ @Mayube Yes seems like it I forgot I said that. \$\endgroup\$
    – Wheat Wizard
    Commented Jun 16, 2017 at 13:26
1
\$\begingroup\$

46. uBASIC, PRINt45

4PRINt45

I ran out of uppercase letters, so I used a lowercase t! I guess you could call it PRIN-t or Printy!

Try it online!

Next Toolbox

\$\endgroup\$
1
\$\begingroup\$

42. S.I.L.O.S, 8 bytes print 41

print 41

Try it online!

Little boring, but it works

Next toolbox

\$\endgroup\$
1
  • \$\begingroup\$ Welcome to SILOS \$\endgroup\$ Commented Jun 16, 2017 at 18:06
1
\$\begingroup\$

48. Racket, cake eating peril (#47)

#lang racket (print 47)

"Cake eating peril?!?", you might ask. Well, if I said peak #7 in a rectilinear triple integral r(4) instead, then you'd all be confused and pinkcartgel() #47 just doesn't make sense, so cake eating peril (#47) was a natural choice. Plus, maybe Racket eats cake in it's free time. We'll never know.

It's no fun to say the chars you used sorted alphabetically. Anagrams are better. I'd suggest you do the same :).

Try it online!

Next Toolbox

\$\endgroup\$
0
1
\$\begingroup\$

54. ///, 2 bytes

53

Sorry for taking your numbers but there's really no better solution.

(oh wait, 5 and 3 got added to the toolbox again)

Try it online!

Next Toolbox

\$\endgroup\$
1
\$\begingroup\$

56. Go

package main

import "fmt"

func main() {
   fmt.Println("55")
}

I learned this language just for this challenge. If I understood the challenge correctly, this should be valid.

Try it Online!

Next Toolbox

\$\endgroup\$
0
\$\begingroup\$

13. Pylons, 14 bytes

2+2+2+2+2+2+2,

Try it online!

Next toolbox

(We now have all the characters)

\$\endgroup\$
4
  • \$\begingroup\$ Could you have done 2+2+2... to save characters? \$\endgroup\$
    – Wheat Wizard
    Commented Jun 14, 2017 at 19:00
  • \$\begingroup\$ I don't understand the next toolbox, could someone please edit it in? \$\endgroup\$
    – user70700
    Commented Jun 14, 2017 at 19:04
  • \$\begingroup\$ @WheatWizard The current toolbox contains 4 es, is there some bug in the implementation? \$\endgroup\$
    – Laikoni
    Commented Jun 14, 2017 at 19:13
  • \$\begingroup\$ @Laikoni Yes there is you can count it as a single e. \$\endgroup\$
    – Wheat Wizard
    Commented Jun 14, 2017 at 19:13
0
\$\begingroup\$

14. CJam, 2 bytes

I'll try to be a bit more creative next time.

13

Try it online!

Next toolbox

\$\endgroup\$
2
  • \$\begingroup\$ Next character set: ABCDEFGHIJKLMNOPQRSTUVWWWWWWWWWWWWWXYZ What? 13 Ws? \$\endgroup\$ Commented Jun 14, 2017 at 20:02
  • \$\begingroup\$ Must be a bug in the python script \$\endgroup\$ Commented Jun 14, 2017 at 20:12
0
\$\begingroup\$

21. Turtlèd

"20"

Try it online!

Next Toolbox:

['elf', 'assembly-as', 'scheme-chez', 'logicode', 'golfscript', 'dstack', 'mariolang']
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f'
\$\endgroup\$
0
\$\begingroup\$

25. Arcyóu

24

Boring, but ¯\_(ツ)_/¯

Try it online!

Next Toolbox:

['elf', 'assembly-as', 'logicode', 'golfscript', 'visual-basic-net-mono', 'python2-pypy', 'silos']
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f'
\$\endgroup\$
0
\$\begingroup\$

26. GolfScript, 2 bytes

25

GolfScript makes this way too easy.

It pushes 25 to the stack, then when the program ends, it prints the stack.

Try it online!

Next Toolbox

Available Languages

  • elf
  • assembly-as
  • logicode
  • visual-basic-net-mono
  • python2-pypy
  • silos
  • haskell
\$\endgroup\$
0
\$\begingroup\$

32. rk, 27 bytes

rk:start print: "31" rk:end

Chars used: "13:adeiknprst

The code is pretty self explanatory, but what surprised me is that rk was created by a 13 year old.

Try it online!

Next Toolbox

\$\endgroup\$
0
\$\begingroup\$

36. Foo, 10 bytes

&2+1$h&5$h

Try it online!

God I hope I understood this challenge correctly.

Chars used: $&+125h

Explanation

&2+1$h&5$h
&2          Set current cell to 2
  +1        Add 1 to current cell
    $h      Print as hexadecimal (i was taken so couldn't print as decimal
              thankfully 0-10 are the same in hex as in decimal)
      &5    Set current cell to 5
        $h  Print as hexadecimal

Next Toolbox

Looks like Go's on the menu now, hope to see something awesome from totallyhuman

\$\endgroup\$
3
  • \$\begingroup\$ now that I think about it perhaps I should've used up 7 and * instead of 1, 2 and +. \$\endgroup\$
    – Mayube
    Commented Jun 16, 2017 at 8:05
  • \$\begingroup\$ @totallyhuman Go is still there. \$\endgroup\$
    – Okx
    Commented Jun 16, 2017 at 10:47
  • \$\begingroup\$ Ah, whoops. I was looking at the wrong section in the toolbox. ^^ And it seems I have every character I can possibly have... \$\endgroup\$ Commented Jun 16, 2017 at 10:49
0
\$\begingroup\$

37. Oasis, 36 bytes

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Try it online!

Next Toolbox

\$\endgroup\$
0
\$\begingroup\$

41. Random Brainfuck, 19 bytes

-[>+<-----]>+.----.

Try it online!

Next toolbox

\$\endgroup\$
0
\$\begingroup\$

40. Reticular, 7 bytes

12+:9O;

Try it online!

Next toolbox

\$\endgroup\$
0
\$\begingroup\$

44. D, "().34;adeilmnoprstvw{}

import std.stdio;void main(){writeln("43");}

Try it online!

Next toolbox

\$\endgroup\$
0
\$\begingroup\$

47. Forth (forth-gforth), 46 .

46 .

Try it online

Well that was easy.

Next Toolbox

\$\endgroup\$
1
  • \$\begingroup\$ You used the input of 46's toolbox for your toolbox. I'll fix it for you \$\endgroup\$ Commented Jun 16, 2017 at 15:39
0
\$\begingroup\$

51. Unlambda, `.05i

`.0`.5i

Try it online!

Next Toolbox

\$\endgroup\$
0
0
\$\begingroup\$

49. brainbool, 26 bytes +><.

+>+<.>.>.>.>.>.

Try it online!

Outputs 110000, which is 48 in base 2

Next toolbox

\$\endgroup\$
0
\$\begingroup\$

50. Kotlin, 4 bytes

->49

Try it online!

Next toolbox.

\$\endgroup\$
0
\$\begingroup\$

52. Factor, 17 bytes

USE: io
"51"print

Try it online!

Next toolbox

\$\endgroup\$
0
\$\begingroup\$

53. Actually, 6DP*

6DP6DD*

Try it online!


6       push 6
 D      pop 6, push 6-1=5
  P     pop 5, push the 5th prime = 13
   6DD  push 6-1-1=4
      * pop 13 and 4, push 13*4=52

Next toolbox

\$\endgroup\$
0
\$\begingroup\$

55. Agony

+++++++++++++++++++++++++++++++++++++++++++++++++++++.-.

I don't really get this language, but it seems to be a superset of brainfuck.

Try it online!

Next toolbox

\$\endgroup\$
1
2

Not the answer you're looking for? Browse other questions tagged or ask your own question.