How high can you count?

158

33

Challenge:

Your task is to write as many programs / functions / snippets as you can, where each one outputs / prints / returns an integer. The first program must output the integer 1, the second one 2 and so on.

You can not reuse any characters between the programs. So, if the first program is: x==x, then you may not use the characters x and = again in any of the other programs. Note: It's allowed to use the same character many times in one program.

Scoring:

The winner will be the submission that counts the highest. In case there's a tie, the winner will be the submission that used the fewest number of bytes in total.

Rules:

  • You can only use a single language for all integers
  • Snippets are allowed!
  • To keep it fair, all characters must be encoded using a single byte in the language you choose.
  • The output must be in decimal. You may not output it with scientific notation or some other alternative format. Outputting floats is OK, as long as all digits that are shown behind the decimal point are 0. So, 4.000 is accepted. Inaccuracies due to FPA is accepted, as long as it's not shown in the output.
  • ans =, leading and trailing spaces and newlines etc. are allowed.
  • You may disregard STDERR, as long as the correct output is returned to STDOUT
  • You may choose to output the integer to STDERR, but only if STDOUT is empty.
  • Symbol independent languages (such as Lenguage) are disallowed
  • Letters are case sensitive a != A.
  • The programs must be independent
  • Whitespace can't be reused
  • You must use ASCII-digits in the output

Explanations are encouraged!

Stewie Griffin

Posted 2017-06-03T12:59:09.773

Reputation: 43 471

4The language Headsecks only cares about the lower three bits of every character and would trivially achieve a score of 64. It's partially symbol-independent, but not completely. I think the last rule should cover partially symbol-independent languages as well, but I'm not sure how to phrase it. – Dennis – 2017-06-04T22:45:31.493

Related: https://codegolf.stackexchange.com/q/50537/25180

– jimmy23013 – 2017-06-05T10:35:09.013

Are command line arguments allowed if they follow the same rules in that they are part of the program when it comes to repetition? – MildlyMilquetoast – 2017-06-06T15:58:02.310

@MistahFiggins I'd assume so, but they'd also count towards the bytecount (minus the - used to denote them) – Skidsdev – 2017-06-06T16:12:05.423

1Regarding the snippet rule, do we still need to include usings/imports? And are static imports allowed (without making them part of the snippet that is)? – Kevin Cruijssen – 2017-06-06T17:45:43.897

1@KevinCruijssen you can omit boilerplate stuff that's needed for every programs/functions. For instance, you don't need #include <iostream> and other boilerplate stuff in C++. You do need from numpy import *. Note: I'm not a programmer, so I don't know all the nuances. We can discuss in chat if something is unclear :) – Stewie Griffin – 2017-06-06T18:05:53.117

@StewieGriffin Ok, no that answers it. In that case I can't do import static java.awt.SystemColor.*; without counting and then use TEXT_TEXT as 13. Thought so, but was just making sure. – Kevin Cruijssen – 2017-06-06T18:10:49.563

Is it possible for the source code to contain unprintable chars (if it is in your 1 byte rule obviously)? (for this)

– V. Courtois – 2017-07-28T10:06:23.147

-1 for the white space rule. – tuskiomi – 2017-08-18T15:50:02.363

1You have the right to vote however you like @tuskiomi, but in my opinion it's a good rule. Whitespace characters are just bytes, just as any other character. Why should they be treated differently? Also, the language Whitespace would win by a landslide, since it contains only space, tab and line shift. Thanks for saying why you downvoted though :-) – Stewie Griffin – 2017-08-18T17:31:23.067

1@StewieGriffin I would at least allow spaces, but hey, I'm not you. – tuskiomi – 2017-08-18T18:30:18.217

Are we allowed leading zeroes? – Jo King – 2018-07-05T15:10:42.270

1Is it okay that my answer uses multi-byte characters but doesn't have any conflicts between the bytes? – Jo King – 2018-07-06T04:21:11.353

Answers

150

JavaScript (ES7), score 17, 176 bytes

They said it couldn't be done, so I did it :D (thanks to a lot of help from @FullDecent)

""**""
~(~/~//~/~/)/~/~/
3
4
!NaN- -!NaN- -!NaN- -!NaN- -!NaN
6
7
8
9
++[[]][+[]]+[+[]]
11
'lengthlength'.length
222>>2>>2
`${``^``}xE`^``
0XF
C=CSS==CSS;C<<C<<C<<C<<C
555555555555555555555%55

Unused characters:

#&,:?@ABDGHIJKLMOPQRTUVWYZ\_bcdfijkmopqrsuvwyz|

I don't think 18 is possible, but I said the same thing about 17...

Explanation

JavaScript is a very weakly typed language; if you try to perform a mathematical operation on a non-number value, JS will try its hardest to convert it to a number first. This allows for a lot of interesting solutions. I've tried to avoid using the digits as much as possible so they can be used later on.

  1. ** is the exponentiation operator in ES7. The empty string when coerced to a number becomes 0, so this calculates 0 ** 0, which is 1 according to JavaScript.
  2. A little ridiculous, but it works. /~/ is a regex literal, and ~/~/ returns -1, so this is ~(-1 / -1) / -1 = ~(1) / -1 = -2 / -1 = 2. (credits to @GOTO0 for the idea)
  3. Simply 3.
  4. Now simply 4.
  5. NaN is falsy, so !NaN is true, which is equivalent to 1. The expression thus becomes 1 - -1 - -1 - -1 - -1 = 1 + 1 + 1 + 1 + 1 = 5.
  6. Simply 6.
  7. Simply 7.
  8. Simply 8.
  9. Simply 9.
  10. This uses a little JSF*** magic. +[] is 0, so [[]][+[]] returns the first element of [[]] (that is, []), and ++ increments this to 1. Then +[+[]] adds the array [0], which is coerced to a string and makes "10".
  11. Simply 11. I originally had used 11&1111 for 3 and 33/3 for 11 until I realized yet again just how dumb I am...
  12. This strategy would work on any number: create a string of length 12 and use .length.
  13. I just messed around with 2s and >s for a while to get this one. I got lucky again: 222 >> 2 is 55, and 55 >> 2 is 13.
  14. This one is rather tricky. The basic idea is to create 14 in hex (0xE), but we need the digit 0 elsewhere. So instead we prepend the result of ``^`` to the string xE; the empty string coerced to a number is 0, so this returns 0 ^ 0 = 0. Then the result is XORed with the empty string, which converts both values to numbers; "0xE" ^ "" is 14.
  15. This is now pretty easy: 0XF is a hexadecimal literal with a value of 15.
  16. The trickiest of all? First we set the variable C to CSS == CSS (that is, true). Then we take the result and perform << C four times, which basically multiplies 1 by 2 ** 4.
  17. JavaScript starts to lose integer precision at 253, which allows 555...555%55 to return a number that's not 0 or 5. I happened to get very lucky while playing around here.

Strategies that would work on many numbers:

  • -!NaN would work on any number (currently 5), though it gets large very fast.
  • ~/~/ would work on any number (currently 2), though it gets very large very fast.
  • +[] would work on any number (currently 10), though it's by far easiest on 10 or 11.
  • .length would work on any number.
  • `${-``}xE`-`` would work on pretty much any number if you do it right.
  • C<<C would work on any power of two (currently 16), or any int at all if you included |.

ETHproductions

Posted 2017-06-03T12:59:09.773

Reputation: 47 880

This conversation has been moved to chat.

– Dennis – 2017-06-04T02:17:09.677

3That's pretty awesome :) – Steve Bennett – 2017-06-06T00:54:58.187

2There might be some sneaky way to use one of the window. properties, like defaultPixelWidth, but they all seem to contain either l or e. You can get another 0 by URL | URL but it doesn't help much. – Steve Bennett – 2017-06-06T01:06:43.580

1I also found "focus", but I'm still not seeing how to get to 18:

"focus" is function(). "focus & focus" is 0. "focus(URL)" is undefined. – Xantix – 2017-06-08T01:44:03.270

@Xantix If we want any hope at all we have to get a non-zero value somehow. If I were to replace the NaNs with URL, we could get isNaN() which is true... – ETHproductions – 2017-06-08T01:46:08.730

All of these except 14 and 15 work in coffeescript. 14 requires changing X to x, and there might be a way to get 15 to work in an ES6 compatible version (e.g. one that allows triple backticks or escaping backticks with a backslash). This gets you the ? operator, which transpiles into != null, which can be used to create more ones and bracketless function calls – user3080953 – 2017-06-08T16:36:51.697

Tiny comment: newline is still unused here. Well, that's how I'm interpreting "whitespace can't be reused". Space has been used in 5, but newline hasn't. – Steve Bennett – 2017-06-14T02:41:09.617

@Xantix In Chrome, there also seems to be cr, dir, copy and Audio, but they all get cast to 0. – Steve Bennett – 2017-06-15T03:28:13.370

0 ** 0 is 1 according to mathematics – Stan Strum – 2017-12-11T01:20:27.307

@user75200 I'd be curious to know what environment you're using that has S as a predefined variable... – ETHproductions – 2018-01-07T20:42:56.960

~/~/>>>~/~//~/~/ with xor can save (), if it's useful to generate more numbers. Maybe 14 `${``|``}xE`|`` 2 2 13 "~/~/AAAAAAAAAAAAAAAAAAAAAAAAAAAA^~/~/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA^~/~/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".replace(/A/g,'>>>~/~//~/~/') – l4m2 – 2018-03-15T20:13:13.447

CSS<URL is true on firefox – l4m2 – 2018-03-15T20:15:44.627

1Current found operators that increase: + - * ~ < x X length – l4m2 – 2018-03-15T22:44:30.477

@l4m2 Ah, I see what you're getting at. In fact, I could do '~/~/'+'>>>~/~//~/~/'.repeat(28) for 15, 0XD for 13, and 2 for 2, and I would have all of the same chars plus ()! I can't see how that would be helpful to get 18 though. Would you mind expanding on your last comment? – ETHproductions – 2018-03-16T00:58:02.153

1The lack of numbers is mainly limited on these symbols. Any number contain one of 1 2 3 4 5 6 7 8 9 + - * ~ < x X length. So before solving it we can't go 18 – l4m2 – 2018-03-16T05:26:06.150

@l4m2 Oh, gotcha. That's a clever way to think about it... With parentheses we can also access isNaN() to get a true, but there's still no way to increase it without one of the operators you mentioned. – ETHproductions – 2018-03-16T12:54:45.687

any builtins with for value true? if it is the case, maybe ~/~/ can be used for 18. – V. Courtois – 2019-08-07T06:31:31.963

PERSISTENT evaluates to 1, might be useful – Redwolf Programs – 2019-12-05T15:17:07.570

92

Jelly, 47 integers, 519 bytes

e
BI$⁼#
⁾⁾⁾Ụ^/
ı***ıḞḞ
5
6
7
.::::
9
EȮ<
⁻GṘ
=`p`VV×`DQV
~A~A~A~A~A~A~A~A~A~A~A~A~A
⁷ṾṾṾw
⁴ḟ€⁴Ṁ
mmmmċ
ṭṭṭṭṭṭṭṭḍḄḄḄḄḄḄḄḄḄ
+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ
CNCNCNCNCNCNCNCNCNCNCNCNCNCNCNCNCNCNC
ĖḌĖḌ
ṫṣȦJṫȦ⁸ȦJ
22
“@ṃ»
!ḤḤ!
³HH
ØaM
;;;;;;;;;;;;;;;;;;;;;;;;;;;¬¬ḅ¬
irið8c
⁶ḲĠṂ°İṂĊ
œṡ¹ẆẆTUṖṖṖṖP
ȷ½RṪ
LµdddddµFL
33
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWŒḊ
ẇɓæ«æ«æ«æ«æ«|æ«|
⁹ṚḢ²
‘‘‘0‘‘‘‘‘‘‘
’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ạ
-____---__________
”(O
⁵ḶxḶ⁵ị⁵ḶxḶḣṢ
⁽{ʂ%⁽{}
ẊẠżv©żvżvżvọ®®Ạżvżvżvọ®
44
111111l11&K1111111Kl11&
,SS¶ỊỊ,ÇS¶ÇÑÇÇÇÑ
ÆnÆnÆnÆnÆnÆnÆnÆnÆnÆnÆnÆnÆnÆnÆn

Every line is a separate, full program.

Try it online! (includes test suite and intersection checker)

How it works

Every full program without command-line arguments executes its main link (defined on the last line) niladically, i.e., without input. If the first link in the chain is a nilad, it is consumed, called, and both the main link's argument and return value are set to the result; if the first link in the chain is a monad or a dyad, it is not consumed and the implicit argument and return value 0 is used instead. In both cases, the remainder of the chain is executed monadically.

Jelly mangles its output in several cases. Notably, a singleton array is printed without its surrounding brackets, so 42 and [42] and indistinguishable after printing. We'll use this on several occasions.

1 – 10

e

The exists atom tests if the return value 0 belongs to the argument 0. It does, so e returns 1.

BI$⁼#

BI$ is a quicklink, specifically a monadic chain formed by the quick $ grouping the binary atom B and the increments atom I. Combined, they convert an integer into the array of its digits in base 2, then compute the forward differences of the resulting digits. If the array has only one element, there are no forward differences and I returns an empty array (falsy); if there are at least two digits, I returns a non-empty array (truthy).

The quick # consumes the previous quicklink and applies it to 0, 1, 2, … until enough matches are found an returns the array of matches. The required amount is calculated by , which compares the return value/argument 0 to itself, yielding 1. Thus, the whole program returns [2], the first non-negative integer with two digits in base 2.

⁾⁾⁾Ụ^/

⁾⁾⁾ is a string literal, specifically the string ⁾⁾. The grade up atom sorts its indices by their corresponding values; since both characters are equal, this yields [1, 2]. The resulting array is reduced with bitwise XOR ^/, so the whole program returns 3.

ı***ıḞḞ

ı initializes argument and return value to the imaginary unit i. * is the exponentiation dyad, whose right argument defaults to the main link's argument. Thus, ***ı computes ((ii)i)i ≈ 4.81 + 0i, the atom (floor for real arguments, real part for complex ones) computes the real part (4.81), then floors, yielding 4.

5
6
7

These three programs consist of a single literal and do exactly what you'd expect.

.::::

The literal . is a shorthand for 0.5 and initializes argument and return value. The integer division dyad's (:) right argument defaults to the main links argument, so :::: computes 0.5/0.5/0.5/0.5/0.5, yielding 8.

9

Another literal.

EȮ<

The all equal atom E returns 1 if all elements in its argument are equal, and 0 if not. An integer argument z is promoted to [z], so E will returns 1 for the implicit argument 0.

Now, the output atom Ȯ prints 1 to STDOUT. We then compare 1 with the implicit argument 0 using the less than atom <. The result is (1 < 0) = 0, and it is printed implicitly when the program finishes.

11 – 20

⁻GṘ

The grid atom G tries to make a visually pleasing table from its argument. For a plain integer argument (here: 0), it simply wraps it in an array. The flat not-equal atom compares the implicit argument 0 with the result to the right ([0]), yielding 1 since its arguments are not equal. The representation atom prints 1 to STDOUT and returns its result. At the end of the program, the final return value is printed implicitly, so we end up with an output of 11.

=`p`VV×`DQV

The self quick ` turns a dyad into a monad by calling it with identical left and right arguments. First, =` compares the implicit argument 0 with itself, yielding 1.

The Cartesian product atom p expects lists as its arguments, so it promotes the integer 1 to the range [1, …, 1] = [1]. p` takes the Cartesian product of [1] and itself, yielding [[1, 1]].

The eval atom V turns all flat arrays (containing only numbers and characters) into strings, then evaluates the resulting strings as niladic Jelly programs. [[1, 1]] is first turned into [“11”], then V evals the string, yielding [11]. Once more, V turns this array into "11", then evals it to yield 11.

Now, ×` multiplies 11 with itself, yielding 121. The decimal atom turns 121 into [1, 2, 1], the unique atom Q discards the second 1, and V once more turns a list of digits into the integer that results from concatenating them, returning 12.

~A~A~A~A~A~A~A~A~A~A~A~A~A

~ is the bitwise NOT atom. With two's complement arithmetic, it maps an argument z to ~z = -(z+1). A is the absolute value atom, so it maps -(z+1) = z+1. With the initial return value 0, the thirteen copies of ~A return 13.

⁷ṾṾṾw

The constant holds the newline character '\n' and initializes the argument and return value.

The uneval atom attempts to create a string representation of its argument z such that a Jelly program consisting of this code would return z.

The first call dutifully returns the string "”\n", which is a character literal. The next call returns "””,”\n" – a pair of character literals. The third and final call returns "””,””,”,,””,”\n" – a quintuplet of character literals.

Finally, the window index atom w promotes its right argument '\n' to the string "\n" and find the first index of a substring starting with "\n". This returns 14.

⁴ḟ€⁴Ṁ

is the constant 16. The quicklink filterfalse each (ḟ€) promotes its left argument 16 to the range [1, …, 16], then iterates over its elements.

For each element z, ḟ⁴ is executed, first promoting z to [z], then removing all (if any) occurrences of 16. This yields the array [[1], [2], …, [14], [15], []], where the last array is empty because it contained 16.

Finally, the maximum atom selects [15].

mmmmċ

The modular atom m – called with arguments x (array) and y (integer) usually takes every |y|th element of x, starting with the first if y > 0, with the last if y < 0. However, when y = 0, it returns x concatenated with its reverse.

The left integer argument 0 is first promoted to [0]. The first copy of m concatenates [0] with itself, yielding [0, 0]. The remaining copies turn this result into [0, 0, 0, 0], then [0, 0, 0, 0, 0, 0, 0, 0], and finally [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0].

At last, the count atom ċ counts the number of times the implicit argument 0 appears in the resulting array, returning 16.

ṭṭṭṭṭṭṭṭḍḄḄḄḄḄḄḄḄḄ

is the tack atom and appends its left argument to its right one. Since and the following are dyadic, all calls to pass the implicit argument 0 as the right argument to . The first call returns [0, 0], the second [0, [0, 0], and the eighth and last [0, [0, [0, [0, [0, [0, [0, [0, 0]]]]]]]].

is the divisibility atom; for arguments x and y, it returns 1 is x is divisible by y, 0 if not. is a no-op for integers, so ḍḄ tests 0 for divisibility by each integer in the constructed array. 0 is divisible by itself, so we get [1, [1, [1, [1, [1, [1, [1, [1, 1]]]]]]]].

Now, the unbinary atom operates on flat arrays. For a pair [a, b], it simply returns 2a + b. As mentioned earlier, is a no-op for integers: an integer argument c is promoted to [c], and [c] in any base is simply c.

The first call to reduces [1, 1] to 3, thus yielding [1, [1, [1, [1, [1, [1, [1, 3]]]]]]]. The next call reduces [1, 3] to 5, the next one [1, 5] to 7, and so forth until the ninth returns 17.

+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ+Ṇ

is the flat logical NOT atom and maps the implicit argument 0 to 1. + is the addition atom, so each of the eighteen copies of +Ṇ increment the previous return value (initially 0). The whole program thus returns 18.

CNCNCNCNCNCNCNCNCNCNCNCNCNCNCNCNCNCNC

C is the complement atom and maps its argument z to 1-z. N is the negate atom and maps its argument z to -z. Together, CN maps z to -(1-z) = z-1, so the eighteen copies turn the implicit argument 0 into -18. A final application of C yields 1 - (-18) = 19.

ĖḌĖḌ

The enumerate atom Ė enumerates the items in an array, creating index-value pairs. The implicit argument 0 is promoted to [0], then Ė yields [[1, 0]]. The undecimal atom converts a flat array from base 10 to integer, yielding [10] in this particular case.

The second call to Ė transforms [10] into [[1, 10]], which the second finally transforms into [20].

21 – 30

ṫṣȦJṫȦ⁸ȦJ

The tail atom (a dyad) select the postfix of its left argument that starts at the index (1-based and modular) specified in its right argument, promoting a left integer argument x to [x]. When called with both arguments set to 0, returns [0].

The any and all atom Ȧ returns 1 if its argument is truthy and contains no zeroes at any depth, 0 otherwise. Here, we simply use it as an identity function to return the implicit argument 0. The split at atom partitions its left argument [0] at occurrences of its right argument 0, so it returns [[], []] here.

The indices atom J discards the elements of the return value and replaces them with their indices, yielding the range [1, 2] in this specific case. Ȧ and both work as before, so they reduce [1, 2] to the postfix that starts at the last index, yielding [2].

In niladic links, the constant holds []. This is an unparseable nilad, i.e., it doesn't fit into the chain in any way. As a result, the previous return value ([2]) is printed to STDOUT, then replaced with the nilad's value ([]).

Since [] is falsy, Ȧ transforms it into 0. The J atom promotes 0 to [0], then returns the list of its indices ([1]), which is printed implicitly when the program finishes.

22

Another literal. Repdigits seem to be the best place to use them.

“@ṃ»

This uses Jelly's inbuilt string compression. The indices of @ and in Jelly's code page are 64 and 220 and string literals can contain 250 different characters, so this first computes the integer 250 × 65 + 220 = 16470.

16470 is divisible by 3, so the quotient 16470/3 = 5490 encodes a printable ASCII character or a linefeed. There are 96 of these and 5490 = 96 × 57 + 18, meaning that we've decoded the printable ASCII character at the 0-based index 18, which is '2'.

We're left with 57, which is also divisible by 3, so the quotient 57/3 = 19 = 96 × 0 + 19 encodes printable ASCII character at the 0-based index 18, which is '3'.

This leaves 0; the decoding process stops. The generated characters are concatenated to form "23"

!ḤḤ!

The factorial atom ! turns the implicit argument 0 into 1. Two invocations of the unhalve atom turn 1 into 2, then 2 into 4. Finally, ! computes 4! = 24.

³HH

In absence of command-line arguments, the constant ³ holds 100. Two invocations of the H turns 100 into 50, then 50 into 25.

ØaM

The constant Øa holds the lowercase alphabet. The maximal atom M yields all indices of maximal items, and since z is the largest lowercase letter, the result is [26].

;;;;;;;;;;;;;;;;;;;;;;;;;;;¬¬ḅ¬

Twenty-six copies of the concatenate atom ; concatenate the initial return value 0 and twenty-six instances of the default argument 0, building an array of 27 zeroes.

¬ is the logical NOT atom, so appends a 1 to the array of zeroes. The next ¬ negates all elements in the array, leaving us with an array of 27 ones and 1 zero.

is the unbase atom and converts a digit array from its left argument from the base specified in its right argument to integer. ḅ¬ converts from unary to integer, so it simply performs a sum. For an array of 27 ones, this returns 27.

irið8c

The index of atom i promotes its left argument 0 to [0], then find the index of its right argument 0 in that array, yielding 1.

The range atom r constructs an ascending or descending range from it's left argument to its right one. The right argument is the implicit argument 0, so this yields [1, 0]. A second invocation of i finds the index of 0 in [1, 0], yielding 2.

ð begins a new, dyadic chain. Since the preceding chain was niladic, both left and right argument of this chain will be equal the first chain's return value (2). c in the combinations atom. With left argument 8 and right argument 2, it counts all unique, unordered 2-combinations of a set of 8 elements, returning 8C2 = 8!/(6!2!) = 28.

⁶ḲĠṂ°İṂĊ

The constant holds a space character and sets argument and return value to ' '. The words atom promotes the character ' ' to the singleton string " " and splits it at spaces, yielding [[], []].

The group atom Ġ groups all indices of equal elements. Since both elements of the last return value are equal, it returns [[1, 2]] here. The minimum atom extracts a minimal (the only) element of this array, yielding [1, 2].

The degree atom ° converts both integers from sexagesimal degrees to radians, yielding 1° × 2π/360° = π/180 and 2° × 2π/360° = π/90. The inverse atom takes the multiplicative inverses, yielding 180/π ≈ 57.3 and 90/π ≈ 28.6.

Then, once more takes the minimum, yielding 28.6. Finally, the ceil atom Ċ transforms 28.6 into 29.

œṡ¹ẆẆTUṖṖṖṖP

The identity atom ¹ returns 0 for the implicit argument 0. The split around atom œṡ promotes both of its arguments (both 0) to [0], then splits [0] around contiguous subarrays equal to [0]. This yields [[], []].

The sliding window atom builds all contiguous subarrays of its argument. The first instance transforms [[], []] into [[[]], [[]], [[], []]], the second instance transforms [[[]], [[]], [[], []]] into
[[[[]]], [[[]]], [[[], []]], [[[]], [[]]], [[[]], [[], []]], [[[]], [[]], [[], []]]].

The truth atom T lists all indices of truthy elements. None of the arrays at the first level are empty, so this yields [1, 2, 3, 4, 5, 6]. The upend atom U reverses this array, yielding [6, 5, 4, 3, 2, 1].

Four copies of the pop atom remove the last four elements, leaving us with [6, 5]. Finally, the product atom P transforms this array into 30.

31 – 40

ȷ½RṪ

ȷ is a shorthand for 1 × 103 = 1000. The square root atom ½ yields 31.6, which the range atom R transforms into [1, …, 31]. Finally, the tail atom extracts the last element, returning 31.

LµdddddµFL

The length atom L promotes the implicit argument 0 to [0], then takes the length to yield 1. µ starts a new, monadic chain, and the result 1 becomes its argument.

For arguments x and y, the divmod atom d yields [x/y, x%y]. Each call will have y = 1, so the result will always be [x, 0].

The first call starts with x = 1, yielding [1, 0]. d only operates on integers, so it vectorizes in subsequent calls. The second call yields [[1, 0], [0, 0]], the third [[[1, 0], [0, 0]], [[0, 0], [0, 0]]], and the fifth and last one an array of depth 5 that contains a single one and 31 zeroes.

µ once more starts a new, monadic chain, and the array from before becomes its argument. The flat atom F unnests this array, yielding a flat array of a single one and 31 zeroes. Finally, L takes the length of the resulting, returning 32.

33

Another repdigit, another literal.

WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWŒḊ

Each instance of the wrap atom transforms its argument z into [z]. With the initial return value of 0, all 34 instances together yield [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]. Finally, the depth atom ŒḊ computes the maximal depth of the resulting array, returning 34.

ẇɓæ«æ«æ«æ«æ«|æ«|

The window exists atom promotes both of its arguments (both default to 0) to [0], then tests if**[0]** occurs as a contiguous subarray of [0]. It does, so returns 1.

ɓ begins a new, dyadic chain. Since the preceding chain was niladic, both left and right argument of this chain will be equal the first chain's return value (1). The chain makes use of two different, dyadic atoms: bitshift left (æ«) and bitwise OR (|).

A dyadic chain that starts with three or more dyads initially calls the first dyad with the chain's arguments. Here, this gives 1 << 1 = 2. The six subsequent dyads are grouped into pairs (so-called forks), where the rightmost dyad is called first with the chain's arguments, then the leftmost one is called with the previous return values to both sides.

For æ«æ«, we get 2 << (1 << 1) = 2 << 2 = 8. Then, æ«æ« computes 8 << (1 << 1) = 8 << 2 = 32. Now, |æ« gets us 32 | (1 << 1) = 32 | 2 = 34.

Finally, the trailing | acts like a hook and is called with the previous return value as its left argument and the chain's right argument as its right one. This returns 34 | 1 = 35.

⁹ṚḢ²

In absence of a second argument, the constant holds 256. The reverse atom promotes 256 to the array [2, 5, 6] and reverses it to yield [6, 5, 2]. Then, the head atom extracts the first element, and the square atom ² returns **6² = 36*.

‘‘‘0‘‘‘‘‘‘‘

The increment atom increments its argument by 1, so ‘‘‘ turn the initial return value 0 into 3. The following 0 is an unparseable nilad, i.e., it doesn't fit into the chain in any way. As a result, the previous return value (3) is printed to STDOUT, then replaced with the nilad's value (0).

The following 7 copies of turn this 0 into 7, which is printed implicitly when the program finishes.

’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ạ

The decrement atom decrements its argument by 1, so thirty-eight copies turn the initial return value 0 into -38. The absolute difference atom computes the unsigned difference between -38 and the implicit argument 0, returning 38.

-____---__________

- is a shorthand for -1 and sets the link's argument and return value to -1. Each _ is an instance of the dyadic subtraction atom, whose right argument will default to -1 if missing.

First, -____- computes (-1) - (-1) - (-1) - (-1) - (-1) = 3. The following -1 is an unparseable nilad, so the previous return value (3) is printed to STDOUT, then replaced with the nilad's value (-1).

Next, -_ computes (-1) - (-1) = 0, where the literal - sets the left argument of _ and uses the return value as the right one. The following nine copies of _ subtract the default argument -1 from the return value, yielding 9, which is printed implicitly when the program finishes.

”(O

”( is a character literal and the ordinal atom O looks up its Unicode code point, yielding 40.

41 – 47

⁵ḶxḶ⁵ị⁵ḶxḶḣṢ

In absence of a third command-line argument, the constant holds 10. The unlength atom creates a 0-based range, specifically [0, …, 9] for argument 10, to both sides of the repeat in place atom x. The latter matches elements of its left argument with repetitions of its right one, and repeats each of the elements the corresponding number of times. With [0, …, 9] as both left and right argument, we thus get zero zeroes, one one, two twos, etc.

The index into atom fetches the element of its right argument at the index specified in its left one. With left argument 10 ( to its left) and right argument [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, …, 9] (previous result), this gives 4.

The chain up to this point is followed by an unparseable nilad , so the previous return value (4) in printed to STDOUT, the return value is set to 10, and the rest of the chain is parsed as usual.

As before, ⁵ḶxḶ will yield the array [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, …, 9]. This time, we call the sorted atom on the argument 10, which promotes 10 to [1, 0], then sorts it to yield [0, 1]. The dyadic head atom now fetches the prefixes of lengths 0 and 1 from the result to the left, leaving us with [[], [1]]. When printed, nothing but 1 will remain visible.

⁽{ʂ%⁽{}

and its two following characters constitute a numeric literal. If j and k are their code points in Jelly's code page and (j, k) < (124, 250), we get the integer 1001 + 250j + k. The code points of '{', '}', and 'ʂ' are 123, 125, and 167, so the left literal evaluates to 1001 + 250 × 123 + 167 (= 31918), while the right one evaluates to 1001 + 250 × 123 + 125 (= 31876).

Since the left integer is less than twice as big as the right one, the result is (… + 167) % (… + 125) = (… + 167) - (… + 125) = 167- 125 = 42.

ẊẠżv©żvżvżvọ®®Ạżvżvżvọ®

The shuffle atom randomizes the order of its argument's elements; a numeric argument z is promoted to the range [1, …, z] beforehand. For the implicit argument 0, this range is empty and yields []. The all atom returns 1 if all of its argument's elements are truthy, 0 if not. Since an empty array does not contain falsy elements, returns 1 here.

The zip with atom ż (a dyad) takes arguments x and y and transposes the pair [x, y]. For integers x and y, this simply yields [[x, y]], so this particular ż, called with arguments 1 and 0 (the implicit argument), returns [[1, 0]]. The dyadic eval atom v turns all flat arrays (containing only numbers and characters) i the left argument into strings, then evaluates the resulting strings as monadic Jelly programs with its right argument as the programs' arguments. Since ["10"] consists solely of literals, this ignores the right argument of v and simply results in [10].

The copy quick © attaches to v and copies its result into the register. Later occurrences of the recall atom ® (a nilad) will fetch [10] from the register.

The next three copies of żv work as before, mapping [10] to [[10, 0] to [100] to … to [10000]. The order atom tests how many times its left argument is divisible by its right one, so here, it computes the order of 10 (fetched with ®) in 10000 = 104, yielding [4].

The following ® is an unparseable nilad, so the previous return value ([4]) is printed to STDOUT, then replaced with the nilad's value (10). We apply next, yielding 1. (This is required as a nilad followed by a dyad would be parseable at this point.)

As before, żvżvżv appends three zeroes to the current return value, turning 1 into [1000]. Finally, ọ® computes the order of 10 in 1000 = 103, and 3 is printed to STDOUT when the program finishes.

44

Yet another repdigit, yet another literal.

111111l11&K1111111Kl11&

First and foremost, the literal 111111 sets the argument and initial return value to 111111. The other runs of 1 are also literals.

l is the logarithm atom , which computes the logarithm of its left argument to the base specified in the right one. When called on 111111 with right argument 11, we get log11111111 ≈ 4.85.

The words atom K joins a list argument at spaces, after promoting a numeric/character z to [z]. Here, we simply use it to turn the link's argument 111111 into [111111]. (We do not require an array here, but we have run out of identity atoms.) The bitwise AND atom & takes the return values to both sides, casts them to integer if required, and computes their bitwise AND. In this particular case, it returns [4.85 & 111111] = [4 & 111111] = [4].

The following 1111111 is an unparseable nilad, so the previous return value ([4]) is printed to STDOUT, then replaced with the nilad's value (1111111). K then turns this integer into [1111111]. (This is once again not really required, but a nilad followed by a dyad would be parseable at this point.)

As before, l11 computes log111111111 ≈ 5.81, then & returns [5.81 & 111111] = [5 & 111111] = [5].

,SS
ỊỊ,ÇS
ÇÑÇÇÇÑ

This is the only program that consists of multiple user-defined links. The last link is the main link and executes when the program starts, the remaining ones are helper links. The quick Ç always refers to the link above the current one and executes it monadically. Likewise, the quick Ñ always refers to the link below the current one (wrapping around) and also executes it monadically.

The top link consists of the pair atom , – a dyad that turns arguments x and y into [x, y] – and the sum atom S – a monad that promotes an integer argument z to [z] and reduces an array argument by addition. When the link ,SS is called with an integer argument n, it computes Σ[n, Σn] = Σ[n, n] = 2n.

The middle link consists of the above atoms, the aforementioned quick Ç, and the insignificant atom – a monad that yields 1 for numeric arguments z with -1 ≤ z ≤ 1, but 0 for all others. Applying twice to an integer argument n essentially replaces it with 1, as the output of the first (the input of the second one) is always insignificant. This result is then paired with the return value of Ç (called with argument n), and the resulting pair is reduced by S. In total, we compute Σ[(|n| ≤ 1) ≤ 1, 2n] = Σ[1, 2n] = 2n + 1.

With these two helper links in place, the main link can now construct any non-negative integer by looking at its binary digits. With an initial return value of 0, the chain ÇÑÇÇÇÑ computes the final result (((((0 × 2 + 1) × 2) × 2 + 1) × 2 + 1) × 2 + 1) × 2 = ((5 × 2 + 1) × 2 + 1) × 2 = 46.

ÆnÆnÆnÆnÆnÆnÆnÆnÆnÆnÆnÆnÆnÆnÆn

The next prime atom finds the smallest positive prime number that is strictly greater than its argument. With initial return value 0, fifteen invocations of Æn compute the fifteenth prime number, which is 47.

Dennis

Posted 2017-06-03T12:59:09.773

Reputation: 196 637

7I've been spending all day trying to catch up to Neim's 38 and then I scroll down and see this. Challenge accepted! – Shaggy – 2017-06-05T00:17:14.117

1TL;DR You got it to count to 47, and you are a wizard at Jelly. – cascading-style – 2017-06-07T06:04:10.893

Are all of the "atoms" single bytes as requested in the challenge? If so, which encoding is this? – M.Herzkamp – 2017-06-07T15:11:49.800

4

@M.Herzkamp Jelly uses its own code page.

– Dennis – 2017-06-07T18:34:49.233

@cascading-style a Jellizard! – QBrute – 2017-06-09T09:26:00.657

1I read the explanation in detail for the first time now. This is truly impressive. Some of these are just ridiculous :-) – Stewie Griffin – 2018-08-07T23:44:55.217

A masterpiece. Could be used as a Jelly course, no jokes there but I'll keep it as a reference for the future. All those tricks could be really nice for golfing in Jelly. – V. Courtois – 2019-08-07T06:46:23.463

65

brainfuck, score 2, 255 144 10 bytes

...Yeah, not the best idea since I only have 8 characters (tarpits gonna tarpit) to work with but let's see how much is possible. I think this is all that's possible. :P This answer demonstrates six of the eight characters brainfuck uses, the other two being ,, which is input and ., which is output.

+
>--[<->-]

Visualize it online!

Explanation

Every number is created and stored on the starting cell on the tape. Heavily relies on the wrapping cells, which are not implemented in a few interpreters.

1:

[ 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 ]
  ^

+  increment the current cell

[ 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 ]
  ^

2:

[ 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 ]
  ^

>  move to the next cell
-- decrement the current cell twice

[ 0 |254| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 ]
      ^

[  while the current cell is not 0
<  move to the previous cell
-  decrement the current cell

[255|254| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 ]
  ^

>  move to the next cell
-  decrement the current cell

[255|253| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 ]
      ^

]  repeat while the current cell is not 0

...

[ 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 ]
      ^

[ 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 ]
  ^

[ 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 ]
      ^

totallyhuman

Posted 2017-06-03T12:59:09.773

Reputation: 15 378

5Now do it in brain-flak. :P – James – 2017-06-05T20:07:34.370

38

Neim, score 38, 327 bytes

1: 
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
8: 8
9: 9
10: β
11: γ
12: δ
13: ε
14: ζ
15: η
16: θ
17: ι
18: κ
19: λ
20: μ
21: ν
22: ξ
23: π
24: ρ
25: σ
26: ς
27: τ
28: υ
29: φ
30: χ
31: ψ
32: ω
33: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
34: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
35: 0000000000000000000000000000000000
36: ℂ
37: ααααααααααααααααααααααααααααααααααααα
38: 

Explanation:

  • For 1, we use the 'check for equality' token, here exploiting that when Neim attempts to pop on empty input, it gets 0. As 0 and 0 are equivalent, this pushes 1 which is implicitly printed
  • From 2 through 9, we just use numeric literals.
  • From 10 through 32, Neim actually has one byte constants for all of them (yes, it's crazy).
  • For 33, we only use the increment command. On the first byte, Neim tries to pop something so it can increment it, but since the input is empty, it defaults to popping 0.
  • For 34, we use the same approach, but decrementing, and taking the absolute value.
  • For 35, we are exploiting the fact that zero factorial is one, and we use that by duplicating the one and repeatedly adding
  • For 36, we use to check 0 and 0 for co-primality, which they are. This pushes 1. Then we get the first prime using , which results in a singleton list containing just 2. We then get the greatest element (), which pushes 2 as a number. Then we repeat this process until we get the list [2 3 5 7 11]. After that, we use to calculate the deltas, resulting in the list [1 2 2 4]. Next, we use to get the sum - which is 9 - then we calculate exclusive range from 0 to 9, resulting in [0 1 2 3 4 5 6 7 8]. Finally, is used again to get 37.
  • For 37, α is a constant that represents negative one, and we repeatedly push it and subtract (again exploiting the fact that when we attempt popping on empty input, 0 is pushed)
  • For 38, once again using the default 0 for empty input, we keep appending 0 to itself, creating a long list, then calculating the length.

Can be tried here

Okx

Posted 2017-06-03T12:59:09.773

Reputation: 15 025

3You have mixed up something around 36-37. – Erik the Outgolfer – 2017-06-04T19:53:36.890

2

Aren't those special characters encoded with more than 1 byte though? If so, that would make it 860 Bytes according to mothereff's byte counter and the challenge rules state that all characters must be encoded using a single byte in the language you choose. Does Neim encode those special characters in only 1 byte? How?

– Hankrecords – 2017-06-05T14:11:20.310

8

@Hankrecords Neim uses a custom codepage

– Okx – 2017-06-05T14:47:49.500

3You haven't used the character 1 yet. Surely you can put that to some use? – Bergi – 2017-06-08T01:53:23.560

34

Python 2, 15

Here's a start, looking for more

Thanks to leo whose tip helped me to get to 15

[[[]]>[]][[]>[]]>>[[]>[]][[]>[]]

2

import math
print'%i'%math.pi

((()<())<())<<((()<())<())<<((()<())<())

5

6

7

8

9

11^1 

33/3

4--4--4

__debug__+__debug__+__debug__+__debug__+__debug__+__debug__+__debug__+__debug__+__debug__+__debug__+__debug__+__debug__+__debug__

q=""=="";qq=q=="";qqq=~q*~q*~q;~qqq*~q*~qq

0xF

Post Rock Garf Hunter

Posted 2017-06-03T12:59:09.773

Reputation: 55 382

2You could use -~-~-~-~-~-~-~-~-~[[]==[]][[]<[]] for 10 and 0xD for 13 for a lower total byte count – ovs – 2017-06-03T14:54:22.163

Could you some how use the fact that ''is'' evaluates to true to make another number? – Notts90 supports Monica – 2017-06-03T20:25:57.667

@Nots90 Unfortunately I'm out of operations To make anything out of it. If you find any way of making new numbers or if booleans let me know – Post Rock Garf Hunter – 2017-06-03T21:00:42.073

114 is missing a closing parens: ((()<((),))|(()<((),))<<(()<((),))|(()<((),))<<(()<((),))<<(()<((),)))<<(()<((),)) – TemporalWolf – 2017-06-05T23:34:01.747

1For the record, your latest rev hasn't used the following from string.printable: c, j, k, l, s, v, w, y, z, A, B, C, D, E, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, !, #, $, &, ., :, ?, @, \\, `, {, }, \t, \r, \x0b, \x0c – wnnmaw – 2017-06-07T21:28:07.483

For 3: use import math;print'%i'%math.pi, saving f – bb94 – 2017-06-11T05:47:49.143

q=""=="";qq="="=="";q=~q*~qq;q=~q*~q;q=~q*~qq;q=~q*~qq;q=~q*~qq;~q*~qq gives 13 – Asone Tuhid – 2018-01-20T23:46:44.327

23

Japt, 448 bytes, score 42

A large collaboration between Shaggy, ETHproductions, & Oliver.

v
y
Íà
Qiiii)iiii)âQ
ÂHq
LÁL
´Vn´VnVnVn
8
9
A
B
C
D
E
F
G
J-----J---J---J---J
[¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾]x
;Iìw
~~½e½e½e½e~½e½
++T+++T+++T+++T+++T+++T
22
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
4á
5²
°UU°°°U°°U°°U°°U°°U
»³³
7/¼
$'_____________________________b'$bb
ZµÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉ
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"aa
Sc
33
Mg011
##
6p
Rí í í í í è.
`¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥`l
¨N|N¹òò¹m···m|¹mò¹m···m|¹mò¹m···m|¹o
º¤¤*º¤*º¤
(Å<<(Å<<(Å<<(Å<<(Å<<(Å^(Å<<(Å<<(Å<<(Å^(Å
Y±Y¶YY±YY±Y±Y¶YY±YY±Y±Y¶YY±Y

These (useful) chars are left:

!%&,:=>?@OPWX\dfhjkrstuz{}¡¢£¦§©ª«¬®¯¸ÀÃÆÇÈÐßãäåæçéêëîïñóôõö×øÿ

Explanations

A couple of things to know about Japt before we start, that I've made frequent use of. Firstly, Japt has 6 variables reserved for input, those being the uppercase letters U-Z. If no input is passed through those variables, they all default to 0. The second thing is covered in this tip.

Click on any snippet to try it in the online interpreter.


v

When applied to a number, the v method takes an integer n as an argument, and returns 1 if the number is divisible by n, 0 if not. If n isn't supplied then it defaults to 2. 0 (the default value for U) is divisible by 2, so this gives us our 1.


y

Very similar to the first one. When applied to a number, the y method takes an integer n as an argument, and returns the GCD of the two numbers. If n isn't supplied then it defaults to 2. Since 0 is divisible by 2, GCD(0, 2) gives us our 2.


Íà
Í is the shortcut for n(2) or 2-this. Because we have no input, we default this to 0, which results in 2-0 = 2.

à returns the number of combinations of [1...this], which returns 3


Qiiii)iiii)âQ

Q defaults to a single quotation mark. i on a string inserts another string at the beginning; as explained in #3, each iiii) is equivalent to .i("i".i("i")) in JS, thus inserting two copies of i at the beginning of the string. Do this twice and you have the string iiii". âQ then simulates .search(Q), giving the index of the first " in the string, which is 4.


ÂHq
H is the constant for 32. When applied to a number the q method, which takes integer n as an argument, returns the nth root of that number. If n is not supplied the default value is 2 so Hq gives us the square root of 32 which is approximately 5.6568. Â is the shortcut for ~~, which floors the result, giving us 5.


LÁL
L is preset to 100, and Á is the shortcut for >>> (zero-fill bitwise right shift). 100>>>100 is the same as 100>>>4 (the right operand wraps mod 32), which is 6.


´Vn´VnVnVn

As noted before, V defaults to 0. ´ is the shortcut for the -- operator, so the code is equivalent to the following JS:

(--V).n((--V).n(V.n(V.n())))

X.n(Y) is equivalent to Y - X, or -X + Y; the first --V returns -1, and the second -2, so this is about equivalent to -(-1) + (-(-2) + (-(-2) + -(-2))). Simplifying, we get 1 + 2 + 2 + 2 = 7.


8
9

Literally, 8 and 9.


A
B
C
D
E
F
G

These are the constants for 10-16, inclusive.


J-----J---J---J---J

J is preset to -1. The Japt interpreter somehow manages to parse this correctly, as (J--) - (--J) - (--J) - (--J) - (--J). Doing some more math, we find that this is equivalent to (-1) - (-3) - (-4) - (-5) - (-6), or -1 + 3 + 4 + 5 + 6 = 17.


[¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾]x

¾ is, as you might guess, a shortcut for .75. We put 24 copies of 0.75 in an array, then sum with x, giving 0.75 * 24 = 18.


;Iìw

I think this is my favourite one. ; at the beginning of the program changes the values of some of the Japt constants; without it I is 64, but with it, I is 91. ìw converts it to a list of digits and runs w on the list, reversing the array, then converts back to a number to get us 19.


~~½e½e½e½e~½e½
½ is a shortcut for .5. e on a number x takes in an argument y and returns x * 10y. So the chain of calculations that happens is:

           ½e½     1.5811  (.5 * sqrt(10))
          ~       -2
        ½e         0.005  (.5 * (10 ** -2))
      ½e           0.5058
    ½e             1.6024
  ½e              20.0138

And the final ~~ serves to floor this to an integer, yielding our result of 20.


++T+++T+++T+++T+++T+++T
T is preset to 0. ++ is the increment operator in JS and also in Japt; T+++T is parsed as (T++) + T, but ++T+++T is parsed as (++T) + (++T), so this is equivalent to the JS code

(++T) + (++T) + (++T) + (++T) + (++T) + (++T)

The result is 1 + 2 + 3 + 4 + 5 + 6, which sums to 21.


22

A literal 22.


ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

Ä is a shortcut for +1, so this simply sums 23 1s.


This finds the number of permutations of [1, 2, 3, 4], which is 4! = 24.


² is a shortcut for p2, which raises a number to the power of two. 5 ** 2 is 25.


°UU°°°U°°U°°U°°U°°U

° is a shortcut for the ++ operator, or if it cannot be parsed as such, + +. As noted before, when there is no input, U defaults to 0. So the code is equivalent to (++U), (U++) + + (++U) + + (++U) + + (++U) + + (++U) + + (++U), which is very similar to #17: U is first incremented to 1, then repeatedly incremented and added such that the final result is 1 + 3 + 4 + 5 + 6 + 7 = 26.


»³³

³ is the shortcut for the p method with an argument of 3. However, if a lowercase letter appears directly after a left-parenthesis (» is the shortcut for ((), it becomes a string. This lets it get passed to a method and called as a function (i.e. would be mapping by .p(3)). In this case, however, ("p",3) returns our3, then we raise it to the power of 3 (p is the power method when applied to a number), which gives us our 27 .


7/¼

¼, as you probably know by now, is a shortcut for .25, so this calculates 7 / 0.25 = 28.


$'_____________________________b'$bb

Anything wrapped in $ symbols is treated as pure JavaScript, so we've got a string of 29 underscores followed by a b. (Without the $, ' would be a single-character string.) The b method when applied to a string returns the first index of its argument within that string. As explained in #3, the last b is converted to a string, so we're grabbing the first index of b in our string, which is 29.


ZµÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉ

µ is a shortcut for -=, and É for -1. The effect is subtracting 30 copies of -1 from 0, which gives 30.


"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"aa

Very much like #29. The a method, when applied to a string, returns the last index of its argument in that string. Using 0-indexing, the last index of a in a string of 32 as is 31.


Sc

S is predefined to a single space, and c on a single-char string returns its char-code, giving 32.


33

Literal 33.


Mg011

MgN returns the Nth Fibonacci number. 011 is 9 in octal; the 9th Fibonacci number is 34.


##

# returns the char-code of the next character. The char-code of # itself happens to be 35, making our job here especially easy.


6p

p is exponentiation, and without a second argument it defaults to 2; thus, this prints 6 ** 2 = 36.


Rí í í í í è.

This one is rather tricky. R defaults to a single newline character (that it's a newline becomes important later). í on a string, without any arguments, takes each character and appends its index: a rather useless transformation, but the result through 5 iterations is this: (using R instead of a literal newline)

R
R0
R001
R0010213
R001021304251637
R0010213042516370849210511112613314715

Interesting how each entry is simply a prefix of the next... But anyway, the last part, è., counts how many matches of /./g are found in the result. There are 38 chars in the string; however, since /./g only matches non-newline chars, the result is 37.


¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥l

Backticks mark a compressed string, and ¥ decompresses to ll. l on a string gives length, so after decompression, this gives 38.


¨N|N¹òò¹m···m|¹mò¹m···m|¹mò¹m···m|¹o

Oooh boy, this one's a doozy. First, we generate true with ¨N (¨ stands for >=, and N with no inputs is the empty array), then convert that to 1 with |N. From there on out it gets pretty crazy:

ò    Inclusive range [0..1],            [0, 1]
 ò   making each an inclusive range.    [[0], [0, 1]]
m·   Join each on newlines.             ["0", "0\n1"]
·    Join on newlines.                  "0\n0\n1"
·    Split on newlines.                 ["0", "0", "1"]
m    Map each item X and index Y to     
 |     X | Y.                           ["0" | 0, "0" | 1, "1" | 2] -> [0, 1, 3]
m    Map each by 
 ò     inclusive range.                 [[0], [0, 1], [0, 1, 2, 3]]
m··· Same as before.                    ["0", "0", "1", "0", "1", "2", "3"]
m|   Bitwise OR thing again.            [0, 1, 3, 3, 5, 7, 7]
mò   Map each by inclusive range.       [[0], [0, 1], ..., [0, 1, 2, 3, 4, 5, 6, 7]]
m··· Same as before.                    ["0", "0", ..., "5", "6", "7"]
m|   Bitwise OR again.                  ["0"|0, "0"|1, ..., "5"|30, "6"|31, "7"|32]
                                        -> [0, 1, ..., 31, 31, 39]

(The ¹s are just substitutes for close-parens and have been omitted.) The final o then pops and returns the final item in the array, giving 39.


º¤¤*º¤

Mostly the same trick as with #3. ¤ is the shortcut for the s method with an argument of 2. In this case, however, the transpiled code is (("s", 2).s(2) * (("s", 2) * (("s", 2)))), or simplified, (2).s(2) * (2 * 2). .s(2) returns the number as a base-2 string, which gives "10"; * (2 * 2) implicitly converts this to a number and multiplies by 4, giving 40.


(Å<<(Å<<(Å<<(Å<<(Å<<(Å^(Å<<(Å<<(Å<<(Å^(Å

Similar to the previous one. Å is the shortcut for the s method with an argument of 1. In this case, however, each transpiles to ("s", 1), which just returns 1. 1<<1<<1<<1<<1<<1 is 32, and 1<<1<<1<<1 is 8; these are XORed together with 1 to get 41.


Y±Y¶YY±YY±Y±Y¶YY±YY±Y±Y¶YY±Y

± is a shortcut for +=, and for ===. This means that the code is actually

Y+=Y===Y,Y+=Y,Y+=Y+=Y===Y,Y+=Y,Y+=Y+=Y===Y,Y+=Y

Y===Y is always true, so we can simplify this some:

Y+=1,Y+=Y,Y+=Y+=1,Y+=Y,Y+=Y+=1,Y+=Y

0 + 1 = 1; 1 + 1 = 2; 2 + (2+1) = 5; 5 + 5 = 10; 10 + (10+1) = 21; 21 + 21 = 42.

Shaggy

Posted 2017-06-03T12:59:09.773

Reputation: 24 623

Wow, this is getting great now :-) You could use Iq for 8 to get 8 back, you'd have to find something else for 19 though. – ETHproductions – 2017-06-04T14:19:10.957

@ETHproductions: just used q for 5 allowing me to use l to add an extra number. Working on an alternative for 2 so I can get the = back. – Shaggy – 2017-06-04T15:08:37.987

@Shaggy You can use for 2. L>>L can free up 6. #w s Å can free up ; and I – Oliver – 2017-06-04T17:55:39.843

Nice trick for 2, @obarakon; I used something similar to free up 3, too. Unfortunately that won't work for 19 as I've already used # for 21. – Shaggy – 2017-06-04T18:54:44.947

I think you can swap 22 with 18 to save a few bytes and get back * and ^ – ETHproductions – 2017-06-08T13:43:01.603

Sorry to bring up this old post again, but you could save an awful lot by doing Y±Y¶YY±Y±Y¶YY±Y±Y¶YY±Y±Y¶YY±Y±Y¶Y for 31. – ETHproductions – 2017-08-15T14:26:58.147

Good shout, @ETHproductions - or, for 2 bytes less: Y±Y¶YY±Y±Y¶YY±Y±Y¶YY±Y±Y¶YY±Y±Y¶Y (ah, I see you edited that into your comment already). Really need to try to make some time to get back to this. – Shaggy – 2017-08-15T14:49:02.137

Golfed off another 133 bytes for you :P Mind if I edit these into the post?

– ETHproductions – 2017-08-15T14:59:06.487

Nice changes, @ETHproductions :) I'd just made that change to 34 & 35 myself and freed up s. Work away editing the rest of them in - should I make this a community wiki, I wonder? – Shaggy – 2017-08-15T15:02:26.677

That might be a good idea, I'd love to help directly. I don't think this is going to get many more upvotes anyway, though I'm not sure if you'll retroactively lose 90 rep... – ETHproductions – 2017-08-15T15:05:55.790

Done. And it looks like I kept the 90 rep. – Shaggy – 2017-08-15T15:09:33.807

You can use A for 10, º¤¤*º¤ for 20, -J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J-J for 36 – Oliver – 2017-08-15T16:42:57.330

@Oliver, this is a community wiki now so you can edit in updates yourself :) – Shaggy – 2017-08-15T16:44:43.003

Whoops, sorry if I interrupted you @Oliver, I think I'm done for now. – ETHproductions – 2017-08-15T16:51:25.940

fwiw, we can use ~~½e½e½ for 19, which frees up ;Iìw – Oliver – 2017-08-15T17:59:57.857

@Oliver Used your trick on 20 instead, though 19 may be more efficient if we can rearrange some things. – ETHproductions – 2017-08-18T20:30:32.773

@ETHproductions Nice. We can use ÐW¹d for 19 if we can free up ¹ or ). – Oliver – 2017-08-18T20:46:05.057

@Oliver I think you could replace the ¹ with a newline. Feel free to edit if you'd like, I'm done for now – ETHproductions – 2017-08-18T20:52:10.640

18

PHP, score 17, 130 Bytes

characters used ADEFGIKLMOPRSTVXYZ=_![]()<>'"#$,;/-+*|^&0123456789afhnprstwx

Z==Z
FTP_MOREDATA
';'&w
![]<<![]<<![]
5
6
"#"|"$"|"1"
8
SIGKILL
333333>>3>>3>>3>>3>>3
99/9
22-2-2-2-2-2
strspn(XXXXXXXXXXXXXX,X)
7+7
0xf
4*4
ha^YV

1 Boolean constant Z (not set) equal constant Z

2 FTP_MOREDATA is a constant in PHP with the value 2

3 bitwise and chars ; and w

4 bitwise Shift left and logical not cast empty array to boolean true with is cast to integer 1 through the shift left operator

7 bitwise Or chars # and $ and 1

9 SIGKILL is a constant in PHP with the value 9

10 bitwise Shift right every step is an integer division with 8 so we have the steps 333333, 41666, 5208, 651, 81 ,10

13 count char X in the string X... from the beginning

15 hexadecimal value f = 15

17 bitwise Xor with the strings ha and YV

All snippets are items in an array

Try it online!

PHP, score 16, 94 Bytes

characters used AEIMPRTUZeflnrstvwx^_&|()[]=!.*+/-<>$":0123456789

Z==Z
":"&"w"    
M_PI|[]
TRUE<<TRUE<<TRUE
5
6
A^v    
8
9
!$s.strlen($s)    
77/7
3+3+3+3
111>>1>>1>>1    
22-2-2-2-2
0xf
4*4

1 Boolean constant Z (not set) equal constant Z

2 bitwise and chars : and w

3 Pi casted to integer value through empty array casted to zero

7 bitwise xor chars A and v

10 variable $s not set !$s = one concat with string length of variable $s

13 111 /2 =55 /2 =27 /2 = 13 Integer division bitwise

15 hexadecimal value f = 15

All snippets are items in an array

Try it online!

PHP, score 14, 84 Bytes

characters used $!_^[]()%/+~-=AEILMNPRUZ0123456789delnrstx

Z==Z
2
M_PI^[]
4
5
6
ERA%11
8
9
!$s.strlen($s)
77/7
3+3+3+3
0xd    
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-NULL

1 Boolean constant Z (not set) equal constant Z

3 Pi casted to integer value through empty array casted to zero

7 ERA is a constant with the value 131116 mod 11 = 7

10 variable $s not set !$s = one concat with string length of variable $s is zero

13 hexadecimal value d = 13 14 bitwise not and minus sign raise NULL to 14

All snippets are items in an array

Try it online!

Jörg Hülsermann

Posted 2017-06-03T12:59:09.773

Reputation: 13 026

17

R, score 13 14

F^F                       # F==0 in R
q=""=="";q--q             # ""=="" is TRUE, TRUE == 1 (Thanks WheatWizard)
3
4
5
6
7
8
9
1e1                       # scientific notation for 10
22/2
T+T+T+T+T+T+T+T+T+T+T+T   # T == 1
0xD                       
sum(mtcars$vs)            # mtcars is a built-in dataset, summing the $vs column gives 14

Got an extra one thanks to user2390246.

Characters used:

0123456789acemqrstuvxDFT^=";-/+()$

BLT

Posted 2017-06-03T12:59:09.773

Reputation: 931

1You can stretch to 14 if we're allowed to use built-in datasets. 1: F^F, 2: "n"%in%"n"+"n"%in%"n"; 3-9: numerals, 10: 1e1, 11: 22/2, 12: T--T--T--T..., 13: 0xD, 14: sum(mtcars$vs) – user2390246 – 2017-06-06T06:00:37.767

Brillant use of % and thinking of using built-in datasets. I can't see why it wouldn't be fine. – BLT – 2017-06-06T14:58:57.637

I did wonder whether it would be possible to get one more using built in data again: if there were a dataset with named rows and columns, you could have a command along the lines of dataset['A','B'], providing it avoided overlapping the letters already used (and happens to contain a useful value!). Unfortunately, as far as I can tell from a quick look, all of the datasets with named rows contain the letter i, so it's not compatible with using %in%. – user2390246 – 2017-06-06T15:35:34.957

Hmmm. For 2, you could use a trick from WheatWizard's Python answer: q=""=="";q+q. That would free up the use of the letters i and n. Don't have time to look into it now, but I bet there's an extra one in there somewhere... – user2390246 – 2017-06-06T15:52:18.467

I think you're right. The main trouble seems to be finding a dataset that doesn't use i,n,s,u,m,t,c,a,r,e,x, or v. Getting some letters back should help. – BLT – 2017-06-06T15:56:09.250

Sorry, I'm afraid I made a mistake on that last suggestion (which was why I deleted the comment). It uses c in two different lines. I'm sure there must be a way to get around it though. Will keep working on it intermittently! – user2390246 – 2017-06-06T19:52:19.677

Gah, precip and mtcars. The problem I was having was running out of operators, so knowing it's at least possible using builtin data is encouraging. – BLT – 2017-06-07T02:22:04.687

16

MATL, score 21 22 23 numbers (273 bytes)

Thanks to J Doe for extending from 22 to 23 numbers!

0~
'bd'd
{P}gk
HH^
5
6
7
8
9
3 3.333333333333333*
11
IEE
[B]Yq
llllllllllllllNwxwxwxwxwxwxwxwxwxwxwxwxwxwx
KUKUa-
4W
FFFFFFFFFFFFFFFFFn
TTTTTTTTTTTTTTTTTTs
rrrrrrrrrrrrrrrrrrrhhhhhhhhhhhhhhhhhhz
OOOOOOOOOOOOOOOOOOOOvZyX>
JJJJJJJJJJJJJJJJJJJJJ++++++++++++++++++++J/
22
`@QQQQQQQQQQQQQQQQQQQQQQ@@<

Try it online! Each snippet in the link is ended by either D (display) or ]D (close loop explicitly and display) to clear the stack and thus isolate from the next snippet.

Explanation

0~

Push 0. Negate. Gives true, which is displayed as 1.

'bd'd

Push string 'bd'. Consecutive difference between characters' code points.

{P}gk

Push cell array containing number pi. Convert to numeric array (i.e. to a single number). Round down.

HH^

Push 2 twice. Power.

5

Numeric literal.

6

Numeric literal.

7

Numeric literal.

8

Numeric literal.

9

Numeric literal.

3 3.333333333333333*

Push 3. Push 3.333333333333333. Multiply. Due to floating point accuracy this gives 10.

11

Numeric literal.

IEE

Push 3. Multiply by 2 twice.

[B]Yq

Push [6] (which is the same as 6). Compute n-th prime.

llllllllllllllNwxwxwxwxwxwxwxwxwxwxwxwxwxwx

Push 1 14 times. Number of elements in stack. Clear the rest of the stack.

KUKUa-

Push 4. Square. Do the same. Any: gives 1. Subtract.

4W

Push 4. 2 raised to that.

FFFFFFFFFFFFFFFFFn

Push array [false false ... false] (17 times). Number of elements in array.

TTTTTTTTTTTTTTTTTTs

Push array [true true ... true] (18 times). Sum of array.

rrrrrrrrrrrrrrrrrrrhhhhhhhhhhhhhhhhhhz

Push 19 random numbers taken from the interval (0,1). Concatenate horizontally 18 times. Number of nonzero elements in array.

OOOOOOOOOOOOOOOOOOOOvZyX>

Push 0 20 times. Concatenate stack contents vertically (gives a column vector). Size: gives the array [20 1]. Maximum of array.

JJJJJJJJJJJJJJJJJJJJJ++++++++++++++++++++J/

Push 1j (imaginary unit) 21 times. Add 20 times. Divide by 1j.

22

Numeric literal

`@QQQQQQQQQQQQQQQQQQQQQQ@@<

Do...while loop (`) with implicit end. In the first iteration it pushes the iteration index (@) and increments it (Q) 22 times, which yields 23. The loop condition (@@<) is false, so the loop is exited.

Some ideas for further improvement

  • (space) in snippet 10 could be replaced by |
  • X> in snippet 20 could be replaced by p, thus freeing prefix X.
  • Currently unused and potentially useful: :, A

Luis Mendo

Posted 2017-06-03T12:59:09.773

Reputation: 87 464

Would you mind including the byte count? – Okx – 2017-06-03T16:18:24.637

@Okx Included now – Luis Mendo – 2017-06-03T16:22:34.513

15

Vim 8 on Windows, score 13, 104 bytes

1
2
3
4
5
6
7
^R=&ts^@
9
8^O^A^O^A
0^[^X^X^X^X^X^X^X^X^X^X^X0x
:h<CR>wwwwwwwwwwwy$:q<CR>p
grgKjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjYZZvPWWWllld|llD

^{keystroke} represents <C-{keystroke}>, so ^X is <C-x>, except for ^@ which is <C-j>. I am still trying to add more numbers to this list and <CR> represents a linefeed.

Note: to run these commands, start vim using -u NONE -U NONE. This is to ensure that your configs will not interfere with the code.

Snippets 1 through 10 start in insert mode. While snippets 12 and 13 starts in normal mode.

Explanations

Snippet 8 is :^R=&ts^@. I have to thank @L3viathan for coming up with this and @nmjcman101 for suggesting ^@ as a replacement for the linefeed and @ØrjanJohansen for shortening &tabstop to &ts. &ts then evaluates to the size of the tab, which is by default at 8, and this value is inserted into the editor.

Snippet 10 is 8^O^A^O^A. We insert an 8, and then increment it twice to get 10.

Snippet 11 is 0^[^X^X^X^X^X^X^X^X^X^X^X0x. We write down a 0 and decrement it 11 times to get -11. Then we remove the minus to get 11.

Snippet 12 is :h<CR>wwwwwwwwwwwy$:q<CR>p. This opens up Vim 8's help menu, which contains the following information:

*help.txt*  For Vim version 8.0.  Last change: 2016 Sep 12

And the sequence of ws move to the 12, at which point y$ copies the number. Then it is pasted into the editor using p.

Snippet 13 is grgKjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjYZZvPWWWllld|llD thanks to @DJMcMayhem for coming up with it. This works only on Windows. The snippet searches the help menu for commands starting with g. Then it moves down using j to get to this line:

|g?|        g?      2  Rot13 encoding operator

after which it copies it and pastes it in the buffer. After that, everything but the 13 is removed from the buffer.

user41805

Posted 2017-06-03T12:59:09.773

Reputation: 16 320

Snippets are allowed. – Leaky Nun – 2017-06-03T14:01:34.747

Would ^R=&tabstop+&tabstop+&tabstop<CR>P give you the 12, or is <CR> already used because of ^M? – L3viathan – 2017-06-03T16:10:52.990

1Yeah, I meant <CR> when I said ^M, but thanks, I will look into removing the ^M from snippet 8 now :) – user41805 – 2017-06-03T16:12:06.033

You seem to use Control in the last two answers. – Post Rock Garf Hunter – 2017-06-05T00:05:21.990

1@WheatWizard The control key does not count as a keystroke nor as a byte, but it is used in combination with other keys and these would be counted as bytes. For example, Ctrl+A gives the byte 0x01 while Ctrl+X gives 0x18. And clearly, these two are separate bytes. Does that make sense? – user41805 – 2017-06-05T03:06:30.020

@KritixiLithos I think you can use ^j instead of <CR> for L3viathan's suggestion. Don't ask me why, but it seems to work in my Vim? – nmjcman101 – 2017-06-05T12:23:49.423

@LeakyNun My solution now uses snippets instead. They either start from insert mode or command mode. – user41805 – 2017-06-05T13:03:31.107

1@L3viathan When starting vim with -u NONE -U NONE, &tabstop evaluates to 8. So I swapped this with the 8 snippet with some modifications, thanks :) – user41805 – 2017-06-05T13:04:20.913

@nmjcman101 Thanks, that also works in my vim. Hmmm... I can also use ^C instead of ^[ for any other snippets if I need to come into normal mode from insert mode. – user41805 – 2017-06-05T13:05:56.820

Is it allowed to start in insert mode like that? I suppose if it isn't, there are plenty of insert mode commands you could do iIaAoOCsSR – James – 2017-06-05T20:10:28.607

@DJMcMayhem well, they are snippets :) – user41805 – 2017-06-06T03:47:03.740

If you had ^A available, you could get 13 with .^A (repeat paste 12 and increase by one). – Roberto Bonvallet – 2017-06-06T14:50:34.610

@RobertoBonvallet But the snippets have to be independent I will not be able to do that. – user41805 – 2017-06-06T15:18:37.150

You can add 13 with grgKjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjYZZvPWWWllld|llD – James – 2017-06-07T20:37:00.057

I see p in both 8 and 12. – Ørjan Johansen – 2017-06-10T14:21:46.027

@ØrjanJohansen 8 is ^R=&tabstop^@ there is nop – user41805 – 2017-06-10T14:24:20.307

tabstop contains a p. – Ørjan Johansen – 2017-06-10T14:25:14.057

Actually I think you just need to abbreviate it to ts. – Ørjan Johansen – 2017-06-10T14:27:51.827

@ØrjanJohansen Yes, you are right, I didn't notice the p in tabstop – user41805 – 2017-06-10T14:38:20.683

@ØrjanJohansen Thanks, now my submission is 5 bytes golfier and is still valid :) – user41805 – 2017-06-10T14:39:47.627

13

Mathematica, score 13

x~D~x
⌊E⌋
3
⌈Pi⌉
5
6
LucasL@4
8
9
0!+0!+0!+0!+0!+0!+0!+0!+0!+0!
77/7
Tr[{11,1}]
-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I

J42161217

Posted 2017-06-03T12:59:09.773

Reputation: 15 931

You should probably remove redundant space characters, it looks like you've reused that character otherwise. – Ørjan Johansen – 2017-06-07T20:25:01.180

1that's not a problem. I will remove them. – J42161217 – 2017-06-07T20:27:14.397

2"all characters must be encoded using a single byte in the language you choose" - I'm afraid that there isn't any encoding that encode the ⌊⌋⌈⌉ things in one byte each... – user202729 – 2017-11-30T13:20:44.133

We can avoid ⌊⌋⌈⌉ by turning ⌊E⌋ into Floor@GoldenRatio, ⌈Pi⌉ into 4, LucasL@4 into 7, and 77/7 into 22/2. It's probably possible to go at least one step further by applying a function with // – Misha Lavrov – 2018-11-09T22:40:39.383

11

05AB1E, Score 18, 67 bytes

X     Variable is initialized to 1
Y     Variable is initialized to 2
2>     2 + 1
4
5
6
7
8
9
T     Constant 10
3b     3 in binary
•C     Ascii code of 'C'
11Ì     11 in hex
A'ok     Index of 'o' in the alphabet
žz¨¤x+     Middle character of '256' times 2, plus itself
¾<<<<n     Variable initialized to 0, 4 times -1, squared
‘c‘‘c‘QDJH     'c' equals itself (true = 1), duplicated, converted from hex to dec
тD÷·±D*·     Constant 100, divided by itself, * 2, bitwise not, times itself, * 2
"d"aÐÐÐÐÐÐÐÐÐ)O     "d" is_alpha (true = 1), triplicated 9 times, total sum

Try it online!

kalsowerus

Posted 2017-06-03T12:59:09.773

Reputation: 1 894

13Your answer is A'ok :) – Okx – 2017-06-03T15:38:05.727

Here are three more: „((Ç;¬ = 20.0 (two-byte char "(("; to ordinal values; halve both; take the tail); ₁.²₁P₃/ï = 21 (log-2 of 256; multiplied by 256; divided by 95; with decimals removed); ₂Ågttγć = 22 (26th Lucas term; two times square-rooted; split in chucks of equal elements; head extracted). The last two were trial and error.. ;) – Kevin Cruijssen – 2018-06-01T14:35:29.933

10

PingPong, score 127

In PingPong, every character has its own distinct numeric value, making counting all the way up to 127 a trivial task. The language works by reading in the value of every character and pushing it to the top of a stack, where all operations are performed. PingPong can theoretically go past 127 but it would require passing a block of characters that simply appear as spaces in a text editor so I left them out of my solution.

1: 1
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
8: 8
9: 9
10: A
11: B
12: C
13: D
14: E
15: F
16: G
17: H
18: I
19: J
20: K
21: L
22: M
23: N
24: O
25: P
26: Q
27: R
28: S
29: T
30: U
31: V
32: W
33: X
34: Y
35: Z
36: a
37: b
38: c
39: d
40: e
41: f
42: g
43: h
44: i
45: j
46: k
47: l
48: m
49: n
50: o
51: p
52: q
53: r
54: s
55: t
56: u
57: v
58: w
59: x
60: y
61: z
62: ©
63: ®
64: À
65: Á
66: Â
67: Ã
68: Ä
69: Å
70: Æ
71: Ç
72: È
73: É
74: Ê
75: Ë
76: Ì
77: Í
78: Î
79: Ï
80: Ð
81: Ñ
82: Ò
83: Ó
84: Ô
85: Õ
86: Ö
87: ×
88: Ø
89: Ù
90: Ú
91: Û
92: Ü
93: Ý
94: Þ
95: ß
96: à
97: á
98: â
99: ã
100: ä
101: å
102: æ
103: ç
104: è
105: é
106: ê
107: ë
108: ì
109: í
110: î
111: ï
112: ð
113: ñ
114: ò
115: ó
116: ô
117: õ
118: ö
119: ÷
120: ø
121: ù
122: ú
123: û
124: ü
125: ý
126: þ
127: ÿ

WaffleCohn

Posted 2017-06-03T12:59:09.773

Reputation: 311

5Ok, this isn't even fair... :P – MD XF – 2017-09-21T02:56:08.237

wow, it's like this language has been done for this challenge :D – V. Courtois – 2019-08-07T06:50:29.113

TIL about another weird language :) – roblogic – 2019-08-07T07:59:17.610

8

Octave, Score 14, 74 bytes

Pretty sure I'm close to the limit now.

1:  ~0                        % Not 0 == 1
2:  "H"/"$"                   % "H" = 72, "$" = 36. H/$ = 2
3:  3                         % Literal
4:  4                         % Literal
5:  5                         % Literal
6:  6                         % Literal
7:  7                         % Literal
8:  8                         % Literal
9:  9                         % Literal
10: ceil(pi*pi)               % pi*pi = 9.87. ceil(9.87) = 10
11: 11                        % Literal
12: 2+2+2+2+2+2               % Well, not much to say
13: ['','RT'-'!']             % 'RT' = [82,84]. Subtract '!' (33) to get ['',49,51]=13
14: nnz...                    % Number of non-zero elements in the string...
    nnnnnnnnnnnnnn            % on this line. (This is an awesome trick by the way!)

Had to remove strchr since I already have c in number 10. I still have j, ^, =, !, space and horizontal tab (ASCII-9) left, so it might be possible to squeeze one more in.

Horizontal tab can be used as a space, so the trick used with strchr and nnz can be used one more time. The only lower case letters left are abdfgjkmoquvwxy. There aren't many functions that can be made out of these. mod could work, but it can't take string input.

It's easy to use the remaining characters to get 1, but I don't know how I can get anything else.

Test all.

Possibly useful: fun a is the same as fun('a'), fun a b is the same as fun('a','b') and so on. This can be used several places:

gt t g    % Equivalent to 't'>'g'. Returns 1. Uses space (available)
or o r    % Equivalent to 'o' | 'r'. Returns 1. 

Using this will make 0 available, but I can't see how to make it useful yet.

e (2.71828...) and j are still unused. Must remove ceil to use e though.

Alternatives (inspiration):

1:  ~0             % Not 0 = 1
2:  2              % Numeral
3:  3              % Numeral
4:  fix(i^i^i^i)   % Numeral
5:  5              % Numeral
6:  6              % Numeral
7:  7              % Numeral
8:  8              % Numeral
9:  9              % Numeral 
10: 1+1+1+1+1+1+1+1+1+1   % Well, not much to explain
11: ['','RR'-'!']  % RR are [82,82] in ASCII, subtract 33 (!) to get
                   % [49,49], and concatenate with the empty string to convert [49,49] to 11 
12: nnz nnnnnnnnnnnn   % Number of non-zero elements in the string containing 12 n
13: "4"/4          % "4" = 52. Divide it by 4 to get 13.

Stewie Griffin

Posted 2017-06-03T12:59:09.773

Reputation: 43 471

7

Dyalog APL, score 15, 89 bytes

≡''
≢###
3
4
⍴⍬⍬⍬⍬⍬
6
⌈○2
8
9
1E1
⎕D⍳⊂⎕D











l:l
7--7-×7
(~0 0 0 0 0 0 0 0 0 0 0 0 0 0)⊥~0
5+5+5

The newlines before l:l are part of 12.

The spaces in 14 represents tabs.

Uriel

Posted 2017-06-03T12:59:09.773

Reputation: 11 708

1I think you may be using space in both 12 and 14. Can APL use tabs instead? – Ørjan Johansen – 2017-06-06T20:49:23.763

@ØrjanJohansen there is no extra space, but I did included mistakenly the lines seperating the snippets – Uriel – 2017-06-06T20:53:19.947

I mean, the space character seems to be used in two entries, 12 and 14. – Ørjan Johansen – 2017-06-06T22:33:48.117

@ØrjanJohansen oh, yes, the last one would go with tabs. – Uriel – 2017-06-06T22:57:25.737

@Uriel some ideas: 0 0 0 -> 0,0,0; ]fromhex f – ngn – 2018-01-22T20:08:12.873

@Uriel {⊢/⍵}⌸⍞⍞⍞⍞⍞⍞⍞⍞⍞⍞⍞⍞⍞⍞⍞⍞ followed by 16 empty lines – ngn – 2018-01-22T20:28:03.650

@ng 1) thanks! 2) I already used newlines in 12 – Uriel – 2018-01-22T23:04:50.403

7

JavaScript (ES7), 16 integers, 137 130 128 bytes

I took @ETHproductions' answer and ran with it for a while; it's changed so much that I'm posting it separately. Ideas are welcome. :)

""**""
-~-~{}
3
C=CSS==CSS;C<<C<<C
5
6
7
8
9
++[[]][+[]]+[+[]]
11
4444444444444444444%44
222>>2>>2
`..............i`.indexOf`i`
0XF
atob('MTY')

Remaining:
$_@#!^&|/?:, ABDEGHIJKLNPQRUVWZcghjklmpqrsuvwyz

Or, if the snippet for 1 is replaced with !!/!//!!/!/:
$_@#^&|*?:", ABDEGHIJKLNPQRUVWZcghjklmpqrsuvwyz


JavaScript (ES7), 16 integers, 127 bytes

One byte shorter. :P

""**""
-~-~{}
3
4
5
6
7
C=CSS==CSS;C<<C<<C<<C
9
++[[]][+[]]+[+[]]
11
`............i`.indexOf`i`
222>>2>>2
0XE
atob('MTU')
88888888888888888%88

Remaining: $_@#!/^&|?:,ABDFGHIJKLNPQRVWYZcghjklmpqrsuvwyz

darrylyeo

Posted 2017-06-03T12:59:09.773

Reputation: 6 214

1Save 7 bytes on 2 with -~{}-~{} :P Overall, though, these are pretty good. Way shorter than mine for sure... – ETHproductions – 2017-06-04T02:14:54.097

1And you still have all of !&/^| left to work with, pretty impressive. If need be, you can use !!/!//!!/!/ for 1 to trade !/ for "*. – ETHproductions – 2017-06-04T02:22:15.617

@ETHproductions Awesome! – darrylyeo – 2017-06-04T02:38:44.570

12 is just -~-~{} – GOTO 0 – 2017-06-04T08:49:19.357

10 can be written as +!![]+[+[]], as long as there is no better use for ! – GOTO 0 – 2017-06-04T08:59:04.280

7

><>, score 20, 93 90 74 65 bytes

(3 bytes saved by Teal Pelican, lots of bytes saved by Jo King!)

iii((
2
3
ll{lll{[
5
6
7
8
!   00=0g
a
b
c
d
e
f
44*
'RA'%
999-9--
"&F#",,
1::+:++:+:+

Try them at the fish playground! You can make the snippets print their results by adding n; to the end of each. Note that the 9th snippet contains a tab, which is eaten by stack exchange.

Explanation:

  • In iii((, each i tries to get input, but since there isn't any, they push EOF = -1 instead. Then ( is the less-than instruction, and since -1 is not less than -1, it pushes a falsey 0; but the second ( asks if -1 is less than 0, which it is, so it pushes a truthy 1.
  • 2 and 3 are obvious.
  • For ll{lll{[, the first l pushes the length of the stack, which is 0, then the second pushes the new length, bringing the stack to 0, 1. The { rotates the stack left, swapping the 1 and 0. Three more ls bring the stack to 1, 0, 2, 3, 4. Then { rotates the 1 to the front, and [ siphons off the first 1 thing on the stack, which is 4.
  • 5, 6, 7 and 8 are obvious too.
  • In !\t00=0g (where \t represents a tab), ! skips the tab, then 00= pushes two zeros and checks if they're equal — they are, so we get a truthy 1. After pushing another 0, the g gets the character in position 1,0 of the code, which is the tab with character code 9.
  • a through to f each push 10 to 15 respectively (presumably to make hexadecimal nice).
  • 44* pushes two 4s and multiplies them together, for 16.
  • 'RA' pushes the character codes of R and A (82 and 65 respectively) to the stack, then % computes 82 mod 65 = 17.
  • 999-9-- evaluates to 9 - ((9 - 9) - 9) = 18.
  • "&F#" pushes the character codes of &, F and #, which are 38, 70 and 35 respectively. Then , is division, so we get 38 / (70 / 35) = 19.
  • Finally, 1:: pushes a 1 and duplicates it twice, + adds two of the ones together to get 2; :+ duplicates the 2 and adds it to itself to get 4; + adds the leftover 1 to get 5; then :+:+ duplicates and adds twice, resulting in 20.

This is the maximum score possible with ><>. Any snippet must include an instruction somewhere that turns an empty stack into a non-empty stack, and there are only 18 ><> instructions that can do that (namely i, l, and the digits 0–9 and a–f), plus string mode. (Every other instruction either does nothing to an empty stack, ><v^/\|_#x!{}r, or tries to pop something and errors, ?.+-*,%=():~$@[]on&gp.) Entering string mode uses either " or ', so there are at most 18 + 2 = 20 snippets possible.


If you're more comfortable with unprintables than I am, this is possible in 53 bytes, thanks to Jo King: 00=, iii((i-, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, 2222***, !Xll$g, 11+::+:+:++, 'Y', "Z", where the X, Y and Z are replaced by characters with codes 17, 19 and 20 respectively.

Not a tree

Posted 2017-06-03T12:59:09.773

Reputation: 3 106

1This is great, I've been looking at this problem and wasn't able to do anywhere near this well but I studied yours and was able to golf it a little bit; 16 can be changed to be; iii((:i$--:i$--:i$--i- and 1 to be changed to be; 00= and you reduce both lines by a couple bytes. – Teal pelican – 2017-06-07T14:50:57.803

@Tealpelican, nice work, thank you! – Not a tree – 2017-06-09T05:10:27.157

1-23 bytes by changing the following 2 > iii((i- 16 > 2222*** 17 > lll{lllll{{[{n (maybe sketchy, but if you want to output as one number, at least there's one less l) 18 > 11+::+:+:++ – Jo King – 2017-12-30T14:38:16.487

@JoKing, wow, that's a big golf! (I went with the less sketchy version of 17 — it seemed more in keeping with the rules.) – Not a tree – 2017-12-30T20:41:04.220

1How about 17 => ! ll$g where the space is replaced by the control character with value 17 (Device Control 1)? – Jo King – 2018-01-21T07:06:37.853

@JoKing, I really don't like using unprintables if I can help it, but your idea inspired another way to trim some bytes, so thank you! If we do include unprintables, though, we might as well go the whole hog and use them in snippets 19 and 20 too. – Not a tree – 2018-01-21T09:45:00.980

7

MathGolf, 48 51 53 60 integers, 419 bytes

î
ª∞~
c±b±+
φⁿ_¥-
5
6
7
○¢i♀/
d²
♂
A
B
C
D
E
☻
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
♥
U
V
W
X
Y
Z
♫¼¼¼¼
88888]Σ
41
╔½½½½½½½½½½½
π░3§3
22#22#
τ╥└
♦⌡⌡⌡⌡⌡⌡⌡⌡⌡
♪■■■■■■■
'0$
ÿÿÿÿÿ£9
))))))))))))))))))))))))))))))))))))))))))))))))))
►◄╠•╠
☼╪╪☼╪╪╪╪╪╪╪╪╪╪╪╪╪%
♣(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
ee*e*e*╒┤\;
╚r▓r▓r▓r▓r▓r▓
♠▒╞y
!⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh"hÞ
◘f√√√√√√√üf√√üf√√√√üf√√√√√√√ü
╟

+2 score (and -2 distinct bytes used for 40) thanks to @maxb.

Each line is a separated program.

Used bytes (114 distinct bytes): îª∞~c±b+φⁿ_¥-567○¢i♀/d²♂ABCDE☻FGHIJKLMNOPQRST♥UVWXYZ♫¼8]Σ41╔½π░3§2#τ╥└♦⌡♪■'0$ÿ£9)►◄╠•╠☼╪%♣(e*╒┤\;╚r▓♠▒╞y!⌠"hÞ◘f√ü╟.

Explanation and TIO-links:

MathGolf is a new golfing language specialized in mathematical golfing challenges. It has loads of single-byte builtins for numbers, making this a perfect challenge for it.

1) î: Push the 1-indexed value of the loop, which is 1 by default: Try it online.
2) ª∞~: Push [1]; double it ([2]); pop list and push its content onto the stack: Try it online.
3) c±b±+: Push -2; then pop and push its absolute value; push -1; then pop and push its absolute value; and add them together Try it online.
4) φⁿ_¥-: Push the golden ratio (1.618033988749895); cube it (4.23606797749979); duplicate the top of the stack; take modulo 2 (0.23606797749979); subtract them from each other: Try it online.
5,6,7) The numbers themselves: Try it online.
8) ○¢i♀/: Push 2048; convert to a hexadecimal string (800); cast to integer; push 100; divide: Try it online.
9) : Push -3; squared: Try it online. 10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38) Push builtins for the numbers themselves (♂ABCDE☻FGHIJKLMNOPQRST♥UVWXYZ): Try it online.
39) ♫¼¼¼¼: Push 10000; integer-divided by 4 four times: Try it online.
40) 88888]Σ: Push 8 five times; wrap them into a list; sum that list: Try it online.
41) The number itself: Try it online.
42) ╔½½½½½½½½½½½: Push 86400; integer-divided by 2 eleven times: Try it online.
43) π░3§3: Push PI (3.141592653589793); cast to string; pop and push its third 0-indexed character (4); push 3; output the entire stack joined together implicitly: Try it online.
44) 22#22#: Push 2 two times; take the power of the two (4); do it again; output the entire stack joined together implicitly: Try it online.
45) τ╥└: Push 2*PI (6.283185307179586); pop and push the power of 2 below it that's closest (4); push the top of the stack + 1 without popping (5); output the entire stack joined together implicitly: Try it online.
46) ♦⌡⌡⌡⌡⌡⌡⌡⌡⌡: Push 64; decrement by 2 nine times: Try it online.
47) ♪■■■■■■■: Push 1000; push next Collatz number (500 → 250 → 125 → 376 → 188 → 94 → 47): Try it online.
48) '0$: Push ordinal value of character '0': Try it online.
49) ÿÿÿÿÿ£9: Push string "ÿÿÿÿ"; pop and push its length (4); push 9; output the entire stack joined together implicitly: Try it online.
50) )))))))))))))))))))))))))))))))))))))))))))))))))): Increment by 1 fifty times: Try it online.
51) ►◄╠•╠: Push 1,000,000; Push 10,000,000; pop both and integer-divide them with each other (10); push 512; pop both and integer-divide them with each other: Try it online.
52) ☼╪╪☼╪╪╪╪╪╪╪╪╪╪╪╪╪%: Push 100000; right-rotate bits twice: (50000 → 25000); push 100000 again; right-rotate bits 13 times (50000 → 25000 → 12500 → 6250 → 3125 → 3610 → 1805 → 1926 → 963 → 993 → 1008 → 504 → 252); modulo Try it online. 53) ♣(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((: Push 128; decremented by 1 seventy-five times: Try it online.
54) ee*e*e*╒┤\;: Push e (2.718281828459045); multiply it by e three times (54.59815003314423); pop and push a list in the range [1,54] (implicitly converts the float to an integer); pop the last value from the list (without popping the list itself); swap the top two values on the stack; and discard the list: Try it online.
55) ╚r▓r▓r▓r▓r▓r▓: push 3600; pop and push a list in the range [0, 3600); pop and leave its average (1799.5); create [0, n) range and take average five more times (899.0 → 449.0 → 224.0 → 111.5 → 55.0): Try it online.
56) ♠▒╞y: push 256; convert it to a list of digits: [2,5,6]; discard the first item: [5,6]; join the list to a string without delimiter: Try it online.
57) !⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠⌠: Push gamma(n+1) (1 by default); increment by 2 twenty-eight times: Try it online.
58) "hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh"hÞ: Push string "hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh"; push its length (without popping the string); remove everything from the stack except for the last item: Try it online.
59) ◘f√√√√√√√üf√√üf√√√√üf√√√√√√√ü: push 1024; pop and push 1024th Fibonacci number (4506699633677819813104383235728886049367860596218604830803023149600030645708721396248792609141030396244873266580345011219530209367425581019871067646094200262285202346655868899711089246778413354004103631553925405243); square-root 7 times (6.713195687359202e+106 → 2.5909835366823933e+53 → 5.09017046539936e+26 → 22561406129493.258 → 4749884.854340498 → 2179.423055384268 → 46.68429131286313); ceil it to 47; take and 47th Fibonacci number (2971215073); square-root it twice again (54508.8531616654 → 233.47131121759992); ceil it to 234; take the 234th Fibonacci number (3577855662560905981638959513147239988861837901112); square-root it four times (1.8915220491870841e+24 → 1375326161020.3901 → 1172743.0072357669 → 1082.9325958875588); ceil it to 1083; take the 1083th Fibonacci number (9641162182178966878126331027202834784434723577592322830700454745652427494401346945631082965963962317692358822696127040961581675695438118874508418491101822679355067810556808551572644321954159676320600161466564032755133080685122); square-root 7 times again (9.818941990957563e+112 → 3.1335191065250526e+56 → 1.7701748802095946e+28 → 133047919194912.42 → 11534639.96815299 → 3396.2685359307193 → 58.27751312410919); and ceil a final time to 59: Try it online.
60) builtin: Try it online.

Builtins left: ◙↕‼¶▬↨↑↓→←∟↔▲▼ %.<=>?@[^`agjklmnopqstuvwxz{|}⌂ÇéâäàåçêëèïìÄÅÉæÆôöòûùƒáíóúñѺ¿⌐¬¡«»│╡╢╖╕╣║╗╜╛┐┴┬├─┼╩╦═╧╨╤╙╘╓╫╪┘┌▄▌▐▀αßΓσµΦΘΩδε∩≥≤÷°∙·.

This still includes quite a few useful things to go further, like: some more integer builtins (◙↕ = [4096,100000000]); a second multiply (.); a second exponentiation (); convert to/from binary as list or string (âäàå); \$2^n\$ (ó); \$10^n\$ (ú); palindromize string/list/integer (ñ); TOS-1 without popping (); left rotate binary bits of integer (); \$\frac{1}{n}\$ (); etc.

Kevin Cruijssen

Posted 2017-06-03T12:59:09.773

Reputation: 67 575

I was working on a solution for this, but I got stuck trying to optimize the 1-9. Once you get to 10 it becomes trivial to reach 38. A few things that I notice at a first glance: 88888ΓΣαΣ -> 88888]Σ or 88888§§§§Σ saves you 2 commands at the cost of using one. You could also do something like "xxxxxx"h where the last character is a non-breaking space which clears everything but TOS and you can use the length of the string to generate the number. Perhaps use something other than x though, because then you've got Wx which gives you 53 as long as you can get 35 another way. – maxb – 2018-11-27T10:10:31.820

Also, I have just added a char/ord operator, which works like 'A$ -> 67, and also works for longer strings (kind of like base-256 integers). It's not extremely well documented, but if you're interested in improving this answer, I could recreate the chat room for MathGolf for any questions. – maxb – 2018-11-27T10:13:23.987

@maxb I saw your comment when I was sick in bed, but I now have some times to improve this answer. Thanks for the 88888]Σ. Didn't knew about ]. As for the "hhhhh"h, that doesn't seem to work. :S

– Kevin Cruijssen – 2018-12-04T12:00:50.017

1

I don't know if it's able to be pasted directly from here, but the code should end with NBSP, the non-breaking space character. That command clears everything but the top of the stack. I'm fairly sure that PPCG converts the character to a regular space here in the comments. Try this

– maxb – 2018-12-04T12:05:54.197

When it comes to arrays, I define them recursively in MathGolf, with [ starting the array context and ] ending it and wrapping the results in an array. To have the top level behave like the lower levels, having ] wrap the entire stack in an array seemed like a good idea. – maxb – 2018-12-04T12:09:35.527

@maxb Thanks for the TIO. I copied the space from the command-page, but it still acted like a regular space for some reason.. We're up to 53 now. – Kevin Cruijssen – 2018-12-04T12:16:56.013

Good job! I'm thinking about changing the non-breaking space into another character, at the same time that I change the null-byte to some usable character, to avoid these problems. Then this solution and 1-2 others will have to be updated, I'll give you an update when that change has been pulled to TIO. – maxb – 2018-12-04T12:20:47.533

6

Java 8, 11 12 13, 39 bytes

Java only has 10 symbols for numbers (0-9) and all method calls and constants require a period, so I'm not sure I can get above 11 outputs

Apparently chars cast to integers by default when operations are applied

+1 with the help of @OlivierGrégoire

i->-~i
2
3
4
5
6
7
8
9
'P'^'Z'
11
"::::::::::::"::length
0xD

Explanations:

i->-~i

integer lambda which takes no input and returns 1. When a parameter takes no input the default value is used as per the above meta post, which for integers is 0

2
3
4
5
6
7
8
9

literal integers

'P'^'Z'

XOR of two characters to return 10

11

literal integer

":::::::::::"::length

lambda expression which returns the length of a 12 character string

0xD

Hexadecimal 13

TIO Link if you want to verify.

PunPun1000

Posted 2017-06-03T12:59:09.773

Reputation: 973

1

Comments are not for extended discussion; this conversation has been moved to chat.

– Dennis – 2017-06-07T01:30:42.927

To shorten the byte count (-6 chars), 2 can be written as 2 and 10 as 'P'^'Z'. Also, this frees the characters X+* and uses P. – Olivier Grégoire – 2017-06-07T11:43:05.593

We require lambda parameters to have types in Java, so i->i.ONE is invalid. – Nathan Merrill – 2017-06-07T13:53:30.977

This more upvoted answer disagrees with you.

– Olivier Grégoire – 2017-06-07T14:59:50.990

Also, this is the first time I see this "requirement" in a year on this website and no one ever disagreed with any of my golfs when such lambdas are used. – Olivier Grégoire – 2017-06-07T15:06:19.800

@mbomb007 Fixed, it was right in the TIO and explanation, just missed the actual part – PunPun1000 – 2017-06-07T18:58:59.017

Can you use True or False to help? – mbomb007 – 2017-06-07T19:00:54.600

Unfortunately, java will not do any kind of coercion from Booleans to integers no matter how hard you try – PunPun1000 – 2017-06-07T19:01:50.543

@PunPun1000 Huh. I guess I didn't know that. I've been using Python instead of Java for recreational programming for so long now. – mbomb007 – 2017-06-07T21:52:04.687

In your lambda, you are passing it a parameter 0 in TIO, which is contrary to your statement that it returns 1 when no parameter is given. – mbomb007 – 2017-06-07T21:56:58.163

According to the linked meta post taking no input means that the supplied values are the defaults. 0 for ints, null of objects, false for booleans – PunPun1000 – 2017-06-07T22:22:35.723

It's so annoying length contains letters that is in every single Constant available.. Otherwise you could use q->-~-~-~-~-~-~-~-~-~-~q for 10, 'O'%'A' for 14 and any constant divided by itself i.e. Math.E/Math.E or Void.TYPE.hashCode()/Void.TYPE.hashCode() for 1. But every single constant available contains one of the letters l,e,n,g,t,h..

– Kevin Cruijssen – 2017-06-08T07:56:01.070

@KevinCruijssen do like me then: search hard for a method returning 12 with more agreeable name than length ;) Without any success so far :( – Olivier Grégoire – 2017-06-08T13:42:35.483

@OlivierGrégoire I indeed tried that, or perhaps 13 or 14, because 'O'%'A' and 0xD are easily increased/decreased. But since we have to add java.util. or other imports a lot are the same (and include a dot .) or e from Void.TYPE.hashCode()/Void.TYPE.hashCode(). I also tried to do something with .size() and Lists, but then you'll also need imports and new. Also, I think we should move all this to chat again.. ;) – Kevin Cruijssen – 2017-06-08T13:56:36.107

I don't have access to chat because it contains chat in the URL. – Olivier Grégoire – 2017-06-08T14:08:34.467

6

Gaia, score 25, 203 bytes

§‼
..⌉+⌉
₵P~~
4
5
6
∂Ql
8
9
¶c
11
'¡ċ⌋u⌋
--⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻
7:,Σ
Ø!))))))))))))))
øøw<øøw<«øøw<«øøw<«øøw<«
⟩‘
₸ḣ₸K$₸ḣ₸/S₸₸/=$
]]]]]]]]]]]]]]]]]]]n
⇑’e
0(((((((((((((((((((((_
22
“B”“↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺B”B
3₈×
ℍḥḥ

I consider this a perfect score, as no more nilads can be used given the character limitations.

Explanations

1. §‼

§ is a space character, is coerce to boolean, so the result is 1.

2. ..⌉+⌉

. is a shortcut for 0.5, so this is ceil(0.5+ceil(0.5)).

3. ₵P~~

₵P is pi, ~ is bitwise negation. Double bitwise negation is simply truncation.

4. 4

5. 5

6. 6

7. ∂Ql

∂Q is a list containing the names of the days of the week, l is length.

8. 8

9. 9

10. ¶c

Code point c of linefeed .

11. 11

12. '¡ċ⌋u⌋

'¡  The string "¡"
ċ   Turn it into a list of code points: [161]
⌋   Minimum: 161
u⌋  Floored square root: 12

13. --⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻-⁻

- is a shorthand for -1, is subtraction. So this is -1 - -1 - -1... enough times to make 13.

14. 7:,Σ

Push 7, duplicate :, pair , the two 7s into a list, and sum Σ.

15. Ø!))))))))))))))

Ø is an empty string, so Ø! is 1. Increment ) 1 14 times.

16. øøw<øøw<«øøw<«øøw<«øøw<«

øø    Push two empty lists
w     Wrap one of them
<     [] < [[]]? (it is, so push 1)
øøw<  Do the same thing again to push another 1
«     Bitshift 1 left by 1
      Do that same thing again 3 more times to get 16

17. ⟩‘

Closing a string with makes it a base-250 number literal. is at byte value 17 in Gaia's code page.

18. ₸ḣ₸K$₸ḣ₸/S₸₸/=$

₸     10
ḣ     doubled
₸     10
K     20 choose 10 (184756)
$     Digit list
₸ḣ₸/  20/10 (2)
S     Split the digit list at index 2 ([[1 8][4 7 5 6]])
₸₸/   10/10 (1)
=     Get the first element of that split ([1 8])
$     Join together and print 18

19. ]]]]]]]]]]]]]]]]]]]n

Each ] wraps the stack in list. Do this 19 times and get the depth n of the list.

20. ⇑’e

Closing a string with makes it a list of codepage code points. e dumps the list on the stack. has a code point of 20 in the codepage.

21. 0(((((((((((((((((((((_

Decrement ( 0 21 times, then negate _.

22. 22

23. “B”“↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺B”B

Convert the string “B” from base-24, where the digits from 0-23 are ↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺↺B. The result is 23.

24. 3₈×

3 × 8.

25. ℍḥḥ

100 halved , and halved again.

Business Cat

Posted 2017-06-03T12:59:09.773

Reputation: 8 927

5

PowerShell, score 12, 91 bytes. 14, 176 bytes

[byte]!![byte]                    # type gets cast to bool false, inverted, to int = 1
-   -$?-shl$?                   # -bool true is -1, shift left, negative. (Tab not space)
3
4
5
6
7
8
9
1+1+1+1+1+1+1+1+1+1
22/2                                           # use the 2
'uuuuuuuuuuuu'.LENGTH                          # string length
0xd
@{z=@{};Y=@{};YY=@{};w=@{};v=@{};U=@{};zz=@{};S=@{};r=@{};q=@{};p=@{};J=@{};K=@{};m=@{}}|% COU*             # count items in hashtable (space)

Edit:

  • Thanks to Ørjan Johansen for suggesting the hex literal 0xd for 13 and the rearranging of 5 to free up 1+1+1+1.. as an option.
  • Changed array length to string length, [int] to [byte] and hashtable to use hashtables as values, freeing up (),"" Pondering 15 with something like "ZZZZZZZZZZZZZZZA".InDeXof("A") but can't reuse the dot or the 'e'..

PowerShell can't do variables without $, can't do exponentiation, bit shifting, Pi, ceil(), etc. with basic symbols, and mostly does type coercian to/from bool and to/from numbers-as-strings, so there's relatively little scope for low-syntax number generation.

TessellatingHeckler

Posted 2017-06-03T12:59:09.773

Reputation: 2 412

You haven't used 0 yet, so 13 can be 0xd. You can put 5 in its normal place, freeing up + for combining 1s. That should get you to 14. If you need to save characters the hashtable keys can be more than one letter. And if you have some spare way of getting 1s to sum, you can do 10 = 1e1. – Ørjan Johansen – 2017-06-12T00:41:55.437

@ØrjanJohansen - good ideas, thanks, edited my answer with them – TessellatingHeckler – 2017-06-12T02:02:03.627

I found a different way of doing 2: ""-(""-(""-lt(""-""))-(""-lt(""-""))). That frees up $? for summing, and then you can do the 1e1 thing I suggested. – Ørjan Johansen – 2017-06-12T03:11:56.327

Um wait the t clashes with both versions of 1. (""-eq"")-(""-(""-eq"")) seems better, the q in the hashtable is easily replaced. – Ørjan Johansen – 2017-06-12T03:21:56.203

5

C, score 13

These are just a bunch of integer constants.

0==0
__LINE__
3
4
5
6
7
8
9
1+1+1+1+1+1+1+1+1+1
'o'/'.' 
2*2*2*2-2-2
strlen("strlenstrlens")
  1. 0==0 evaluates to 1
  2. Assumes code is on line 2. __LINE__ = 2
  3. Integer constant
  4. Integer constant
  5. Integer constant
  6. Integer constant
  7. Integer constant
  8. Integer constant
  9. Integer constant
  10. 1+1+1... = 1*10 = 10
  11. 'o' is 111, '.' represents the unprintable ASCII 0x10. 111/10 = 11
  12. (2<<2) = 8, 8*2 = 16, 16-2-2 = 12
  13. string length of "strlenstrlens" = 13

MD XF

Posted 2017-06-03T12:59:09.773

Reputation: 11 605

5

Ohm, score 21 22, 160 total bytes

╓S@Ri
ΓΓ-Γ-Γ-
αê⌠
¡¡¡¡¼
5
▀lll▀l
ÑÑÑÑÑÑÑÿWÿk
ü`½½
9
..≥°
$$J
3dd
7ƒ
2≡≡≡Σ
║F
4º
0ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~
6DD++
8π
τ╛hτ*
"≤"≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤A
1111 11v11%L1111 11v11%L

Try it online!

Explanations

1. ╓S@Ri

Push the seconds of the current date/time (╓S). Get the inclusive range from 1 to seconds (@), reverse it (R), get the last element (i), which is always 1.

2. ΓΓ-Γ-Γ-

Γ is -1, so this is (-1) - (-1) - (-1) - (-1), which is 2.

3. αê⌠

αê is Euler's number (2.71828...), is ceiling. 3 is the result.

4. ¡¡¡¡¼

¡ increments the counter, ¼ pushes the counter.

5. 5

Just a literal.

6. ▀lll▀l

▀lll▀ is a compressed string literal which is equivalent to "of >ic". l takes the length, so the result is 6.

7. ÑÑÑÑÑÑÑÿWÿk

First we push 7 newline chars (Ñ) and then an empty string (ÿ). The stack is wrapped in an array (W), and then the index of the empty string in that array is found.

8. ü`½½

ü is a space character. ` pushes its ASCII value (32), then it gets halved twice (½½).

9. 9

Just a literal.

10. ..≥°

.. is a literal . character. It gets incremented (), which parses the string as a number, defaulting to 0 since it's not a valid number, and increments it to 1. Then we compute 101 (°).

11. $$J

$ pushes the current value of the register, initially 1. So, push 1 twice, join the stack together and print.

12. 3dd

Push 3 and double it twice.

13.

Pushes the 7th Fibonacci number.

14. 2≡≡≡Σ

Push 2, triplicate it three times, leaving 7 2's on the stack. Then take the sum of the stack (Σ).

15. ║F

is the delimiter for base-220 number literals. Since this is at the end of a line, it doesn't need to be terminated.

16.

Compute 24.

17. 0ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~ò~

ò is bitwise negate, ~ is arithmetic negate. Combining these operators, we can increment 0 17 times.

18. 6DD++

Push 6, duplicate it twice, and compute 6+6+6.

19.

Push the 8th prime number.

20. τ╛hτ*

Push 10 (τ), get the first element (h) of its prime factors (), multiply that by 10.

21. "≤"≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤≤A

Similarly to previous snippets, the string "≤" gets parsed as 0. We decrement it 21 times, then take the absolute value.

22. 1111 11v11%L1111 11v11%L

Here we compute 1111 div 11 mod 11, which is 2, then print 2. Then do it again.

Business Cat

Posted 2017-06-03T12:59:09.773

Reputation: 8 927

5

TI-Basic (83 series), score 21 22 23 24 25 (1003 bytes)

1:  A=A
2:  int(tan(tan(cos(cos(cos(B
3:  tanh⁻¹(√(√(√(√(√(√(√(√(√(√(C!°√(√(C!°
        √(√(√(√(√(√(C!°√(√(√(√(√(√(C!°√(
        C!°√(√(√(C!°√(C!°√(C!°√(√(√(√(√(
        √(C!°√(C!°√(C!°√(C!°
4:  4
5:  cosh(sinh⁻¹(cosh(sinh⁻¹(...sinh⁻¹(cosh(D    with 25 repetitions of cosh(
6:  6
7:  7
8:  8
9:  9
10: ₁₀^(₁₀^(E
11: 11
12: F nPr F/sin(tan⁻¹(...(sin(tan⁻¹(F nPr F     with 143 repetitions of sin(tan⁻¹(
13: det([[G≤G]...[G≤G]]ᵀ[[G≤G]...[G≤G           with 26 repetitions of G≤G
14: ln(tanh(not(H))...tanh(not(H)))
        ln(tanh(not(H)))^⁻not(H                 with 14+1 repetitions of tanh(not(H))
15: iPart(e^(e^(e^(I
16: sum(dim(identity(sum(dim(identity(sum(
        dim(identity(sum(dim(identity(J≥J
17: K nCr K+K nCr K+...+K nCr K                 with 17 repetitions of K nCr K
18: abs(i-i-...-i                               with 20 repetitions of i
19: rand→L:log(LL...LL→M:log(L→N:N⁻¹M           with 19 L's inside the log
20: mean(seq(OOO,O,O,sinh(sinh(cos⁻¹(O
21: ππ³√(π³√(ππ³√(ππ³√(ππ³√(π³√(³√(ππ³√(π³
        √(π³√(ππ³√(π³√(ππ³√(ππ³√(ππ³√(π³√(
        π³√(³√(ππ³√(ππ
22: 22
23: 3(3(3×√(3(3(3×√(3(3×√(3(3(3×√(3×√(3×√(
        3(3×√(3(3×√(3(3(3×√(3(3×√(3×√(3(3(
        3×√(3(3×√(3×√(3×√(3(3(3×√(3(3×√(3(
        3(3×√(3×√(3(3(3×√3
24: Fix 0
    sin⁻¹(ᴇ0
    AnsAnsAnsAnsAnsAnsAns
25: 5*5

Refer to http://tibasicdev.wikidot.com/one-byte-tokens for a list of which things the challenge does and does not allow here.

All of these can be complete programs, since the last line of a program gets printed automatically. But (except for 17, which is multiple lines long) they can also be snippets on the home screen.

At this point, I see no other way to get any nonzero value out of the remaining tokens available. If there's any improvement to be made, it will have to involve first making some of the solutions above more conservative.

Explanations

  • A=A is a boolean 1 because the variable A is equal to itself.
  • B is 0 by default, tan(tan(cos(cos(cos(B is about 2.21, and then we take the floor.
  • C!° is 1 degree in radians, about 0.017. Some positive power of this is tanh(2), about 0.964. We encode that power in binary using implied multiplication and √(, and then take tanh⁻¹(.
  • 4 is straightforward
  • cosh(sinh⁻¹(X simplifies to \$\sqrt{1+X^2}\$, and used 25 times it gives us 5.
  • 6-9 are straightforward
  • ₁₀^( is a one-byte built-in for powers of 10, and 10^10^0 = 10^1 = 10.
  • 11 is 11.
  • Another instance of the trick used on 5. F nPr F is 1. sin(tan⁻¹(X simplifies to \$\frac{1}{\sqrt{1+1/X^2}}\$, and used 143 times starting with 1 it gives us 1/12. Dividing 1 by this number is 12.
  • G≤G is 1, so [[G≤G]...[G≤G]] is a 13x1 column vector. Taking the product of its transpose with itself gives the matrix [[13]], whose determinant is 13.
  • not(H) is 1. tanh(not(H)) is just some number not equal to 0 or 1, and ln(XXX....X)ln(X)^⁻1 will simplify to the number of X's in the first log provided that X is not 0 (so that the log exists) and not 1 (so that we're not dividing by 0).
  • e^(e^(e^(F evaluates to about 15.15, and then we take the floor.
  • J≥J is 1. identity( constructs a 1x1 identity matrix, dim( finds its row and column dimensions, and sum( adds them to get 2. Then we do this again, adding the dimensions of a 2x2 matrix to get 4, and again, adding the dimensions of a 4x4 matrix to get 8, and again, adding the dimensions of a 8x8 matrix to get 16.
  • K nCr K is the binomial coefficient 0 choose 0, or 1. Adding together 17 1's gives 17.
  • i-i-...-i simplifies to ⁻18i, and taking abs( gives 18.
  • rand→L stores a random real number to L, but we don't care what it is. We are computing log(L)⁻¹log(L^19), which simplifies to 19.
  • sinh(sinh(cos⁻¹(I is a bit over 4, so seq(III,I,I,sinh(sinh(cos⁻¹(I gives the list {0 1 8 27 64} whose arithmetic mean is 20.
  • Another instance of the trick used to get 3. Here, some power of π should give 21; we encode that power in ternary using implied multiplication and ³√(.
  • 22 is 22.
  • Another instance of the trick used to get 3 and 21. We encode the power of 3 that equals 23 in ternary, using 3×√( as cube root and ( for multiplication.
  • Fix 0 is the setting for displaying 0 digits after the decimal, rounding all values to integers. sin⁻¹(ᴇ0 evaluates to π/2, and π/2 multiplied by itself 7 times gives about 23.59, which rounds to 24.
  • 5*5 is 25. (It would be more conservative to use 5 to get 5, and adapt the solution used there for 25. But this way saves lots of space, and * isn't a very useful character because implied multiplication exists.)

Misha Lavrov

Posted 2017-06-03T12:59:09.773

Reputation: 4 846

Xmax is 10 by default, same with Ymax=10, Ymin=Xmin=-10 and some other default values. – lirtosiast – 2018-11-11T01:37:19.977

@lirtosiast All of these are two bytes. – Misha Lavrov – 2018-11-11T01:41:22.553

I'm not sure about the interpretation of the rules, but I think you can still use one of them without repeating any bytes (considering characters as bytes rather than tokens) – lirtosiast – 2018-11-11T01:48:49.533

I'm vaguely skeptical about that interpretation. In any case, counting characters as bytes, it would have to be something like Xfact=4, since Xmax conflicts with °. We'd probably be able to get one point out of that, another point out of the 2-byte commands, and a third point out of the TI-84-only commands. – Misha Lavrov – 2018-11-11T01:51:43.763

4

SOGL, score 16 18 20, 109 bytes, 47 characters used

=                    push ""=""
ρ:¾/U                ceil(isPalindrome("")/(isPalindrome("")*(3/4))) -> ceil(1/(3/4)) -> ceil(4/3)
3                    push 3
MM¼÷                 100/(100*1/4)
æ⁄                   length of "aeiou"
6                    push 6
7                    push 7
Nτ                   log2(256)
9                    push 9
L                    push 10
⁹’                   byte with the 11th SOGL code point
Ιζrkk"⁸              `⁸`s UTF-8 codepoint to string, take off 1st 2 chars
'⁰                   messy compression
īuHHHHHHHHHHHHHH±    floor(0.1) `-1` 14 times, then change sign
aIIIIIIIIIIIIIII     A `+1` 15 times, A = 0
4²                   4^2
lllllllllllllllll”l  length of "lllllllllllllllll"
222222222++++++++    2+2+2+2+2+2+2+2+2
δ“○“-                429-420
Μ℮‘                  compressed string of "2ŗ" where ŗ defaults to 0

dzaima

Posted 2017-06-03T12:59:09.773

Reputation: 19 048

4

Brachylog, 16 integers, 86 bytes

1
2
3
4
5
6
7
8
9
ℕ<<<<<<<<<<
≜+₁₁
Ịbkkkkkkkị
Ḥl
ℤ₇×₂ṅ
"____**"pᶜ¹
⟦h>>>>>>>>>>>>>>>>ȧ

Try it online! (The input controls which program is ran, from 1 to N)

Explanation

                       The output is...

1                      1
2                      2
3                      3
4                      4
5                      5
6                      6
7                      7
8                      8
9                      9
ℕ<<<<<<<<<<            Strictly bigger than ... strictly bigger than 0
≜+₁₁                   0 + 11
Ịbkkkkkkkị             "12" converted to an integer
Ḥl                     The length of "Hello, World!"
ℤ₇×₂ṅ                  -(-7 × 2)
"____**"pᶜ¹            The number of unique permutations of "____**"
⟦h>>>>>>>>>>>>>>>>ȧ    The absolute value of stricly less than ... stricly less than 0

Fatalize

Posted 2017-06-03T12:59:09.773

Reputation: 32 976

1Just thought about Prolog: 1, since you always need a dot at the end. – false – 2017-06-05T23:00:08.110

4

CJam, score 27, 168 bytes

1-3: X, Y, Z

The variables X, Y, and Z are initialized to 1, 2, and 3, respectively.

4: ",,,,",

Push the string ,,,, and take the length.

5-9: 5, 6, 7, 8, 9

Numeric literals.

10-20: A-K

Preinitialized variables.

21: U)))))))))))))))))))))

The variable U is initialized to 0. Push U and increment it 22 times.

22: 22

Numeric literal.

23: ';(((((((((';((((((((

Push the character ; and decrement it 9 times to get 2, then push ; again and decrement it 8 times to get 3.

24: 4m!

Take the factorial of 4.

25: TT=TT=+TT=TT=TT=TT=TT=++++

TT= pushes 1. This code is equivalent to 1 1+1 1 1 1 1++++.

26: N:i~W-W-W-W-W-W-W-W-W-W-W-W-W-W-W-W-

N pushes a string containing a newline. :i converts it into a list of character codes, yielding [10]. ~ unpacks it, giving 10. W- is the equivalent of adding one. Incrementing 10 sixteen times gives 26.

27: LLLLLLLLLLLLLLLLLLLLLLLLLLL0]0#

Find the index of 0 in a list where 0 is at the 27th index.

Characters still available: $%&*./1<>?@MOPQRSV[\^_`abcdefghjklmnopqrstuvwxyz{|}

A few notes for potential expansion:

  • I might have to change 10-20 in order to use the variables for something else. If I get numbers higher than 1, I can use * (and possibly bitwise operators, but I don't think they'll help much).

  • I still have S, whatever good that'll do me.

  • If I change 26 to N{}/iW-W-W-W-W-W-W-W-W-W-W-W-W-W-W-W-, then : will be available.

  • I can push some empty lists and get more zeroes with existing variables. I can also get π, but that doesn't seem very useful unless I can cast it to an integer somehow, and m (for m[) and i are already taken.

  • In terms of array manipulation, I can:

    • Use a map with % or f
    • Use a fold with *
    • Do some setwise operations
    • Base conversion (this seems promising, but I don't know how I would get the base number)
    • Construct arrays by using |: M1|2|3|

Esolanging Fruit

Posted 2017-06-03T12:59:09.773

Reputation: 13 542

Just a note, you could make 21 be U))))))))))))))))))))) and 22 be 22 which would free 1 for a later snippet. – Business Cat – 2017-06-05T14:16:24.877

@BusinessCat Thanks, edited. – Esolanging Fruit – 2017-06-05T17:58:27.423

To convert pi to an integer, you could make use of the fact that base conversion does an implicit :i on the digit list (e.g. [P]1b gives 3). – Martin Ender – 2017-06-07T14:15:11.983

If you don't mind making 23 a lot longer you could use '' instead of '; and then use enough ( to wrap around to the digits (so about 65k ( for each digit). That would free up ; for something else, but I'm not sure how useful that is. – Martin Ender – 2017-06-07T14:16:41.930

@MartinEnder I'll do that if I see a use for ;, but at the moment I can't. – Esolanging Fruit – 2017-06-11T22:38:13.373

4

Haskell, score 13, 86 bytes

pi/pi
sum[sum[]^sum[],sum[]^sum[]]
3
4
5
6
7
8
9
length"eeeeeeeeee"
11
2+2+2+2+2+2
0xD

Try it online!

Thanks to Ørjan Johansen for finding a way to fix my letter overlap while preserving the score of thirteen. (Also for going out of their way to notify me about this while this answer was deleted.)

pi/pi is 1.0.
sum[] evaluates to 0, 0^0 to 1 and sum[1,1] to 2. 3 to 9 just decode themselves.
length"eeeeeeeeee" yields the length of the string, which is 10.
2+2+2+2+2+2 is 12.
0xD is hexadecimal for 13.

Laikoni

Posted 2017-06-03T12:59:09.773

Reputation: 23 676

You have some letter overlap. – xnor – 2017-06-04T19:12:20.070

@xnor Thanks for pointing out. Should be fixed now. – Laikoni – 2017-06-05T18:40:05.227

4

Reng, score 40, 149 bytes

Try it here!

1.  e
2.  2
3.  ::l
4.  4
5.  5
6.  i`i`i`i`i`i`+++++
7.  7
8.  8
9.  9
10. A
11. ÇÇÇǹ
12. C
13* [[[[[[[[[[[[[mn~
14. E
15. F
16. G
17. H
18. I
19. J
20. K
21. L
22. M
23. N
24. O
25. P
26. Q
27. R
28. S
29. T
30. U
31. V
32. W
33. X
34. Y
35. Z
36. 6²
37. "%"
38* &fæ¦
39. D3*
40. 11±$1±±±±±±±±$11±$1±±±±$±$

All uppercase letters are numbers, so that's nice. All but two of these are snippets. The two that are programs:

13. [[[[[[[[[[[[[mn~
38. &fæ¦

The link provided allows one to see the stack while running. I'll write an explanation later.

Conor O'Brien

Posted 2017-06-03T12:59:09.773

Reputation: 36 228

4

Braingolf, score 14, 81 bytes

1-  ^
2-  2
3-  3
4-  4
5-  5
6-  6
7-  7
8-  8
9-  9
10- "
    "
11- llllllllllll
12- VR# d<Mv/_R_
13- 111-1-1-1-1-1-1-1-1-1-1-1-1--
14- H.............&+

Characters used: 123456789^"e\nJ-+lVR# d<Mv/_&

Things to note that might be useful:

P can also be used at the start of a program to push a 1, as an empty stack is considered palindromic (does the same thing as H)

Main issue with this is + has already been used, and I can't think of any other way in Braingolf to turn any amount of 1s into anything higher than 1

Explanation:

1

^  
^   niladic exponentiation, 0^0.
    This is undefined mathematically, however python, in which
    Braingolf's interpreter is written, returns 1
    implicit output of last item on stack

2-9

2    push integer literal
     implicit output of last item on stack

10

"\n"  push charcode of newline, 10
      implicit output of last item on stack

11

llllllllllll
l             push length of stack (0)
 l            push length of stack (1)
  .........l  push length of stack (11)
              implicit output of last item on stack

12

VR# d<Mv/_R_
VR            create stack2 then return to stack1
  #<space>    push 32
    d         split 32 into 3, 2
     <        move first item to end of stack
      M       move last item to stack2
       v      switch to stack2
        /     monadic division, always returns 1
         _    print last item on stack (1)
          R   return to stack1
           _  print last item on stack (2)

13

111-1-1-1-1-1-1-1-1-1-1-1-1--
111                            Push 3 1s [1, 1, 1]
   -                           Subtract last 2 items [1, 0]
    1-                         Push 1 and subtract [1, -1]
      1-1-1-1-1-1-1-1-1-1-1-   Push 11 more 1s and subtract each one [1, -12]
                            -  Subtract [13]
                               implicit output of last item on stack

14

H.............&+
H                 Push 1, empty stack is always palindromic
 .............    Duplicate the 1 13 times, stack now has 14 1s
              &+  Sum entire stack
                  implicit output of last item on stack

Skidsdev

Posted 2017-06-03T12:59:09.773

Reputation: 9 656

Using two digits in the same entry seems like a waste. What about doing 10 as "<newline>", 9 as 9, and 13 as 1111111111111++++++++++++? – Ørjan Johansen – 2017-06-06T21:01:30.490

Or alternatively 111-1-1-1-1-1-1-1-1-1-1-1-1-1-1-- if you have more use for the + elsewhere. – Ørjan Johansen – 2017-06-06T21:08:21.600

@ØrjanJohansen Oh wow, thanks! – Skidsdev – 2017-06-07T08:17:01.953

4

Forth, score 10 11 12 13 14, 196 bytes

Tokens are case-insensitive, which helps a bunch. Also, TIO allows a bunch of different whitespace characters as token separators.

1

j
j
j
<
>
abs

2 - 14

J	J	=	J	J	=	-	J	J	=	-	J	J	=	-
3
4
5
6
7
8
9
0xA
11
222222+++++
I I / I I / LSHIFT I I / LSHIFT I I / LSHIFT I I / I I / LSHIFT I I / LSHIFT I I / OR OR
kkkkkkkkkkkkkkdepth

Try it online - slightly weird/inconvenient. And #14 uses stack depth, so it must occur after printing the others.

Explanation:

    1. Use some comparisons to obtain True, which evaluates to -1, then take the absolute value. See #2 for a description of j. This uses linefeeds to separate the tokens.
    1. J is a loop counter, used for inner loops, and is also some large number when not inside a user-defined loop. Checking if it equals itself returns -1 (True). Using subtraction, I obtain 2. This uses tabs to separate the tokens.
    1. This uses vertical tabs
      (ASCII 11) to separate the tokens. See the TIO link.
    1. I pushes the loop counter, which is some large unknown number when outside a loop. Divide it by itself to get 1. I use bit-shifting with lshift and OR.
    1. Push k, another loop counter, a bunch of times, then get the stack depth. This uses form feeds (ASCII 12) to separate the tokens. Select the line to see there are actually characters there. Using shift + arrow keys while having the line selected will show that there is an invisible character after each k.

I can lower the byte count by using more unique bytes (like *), but for the moment I'm going to use as few unique bytes as possible.

mbomb007

Posted 2017-06-03T12:59:09.773

Reputation: 21 944

Can you use something like variable v v @ v @ = negate for 1, freeing 1 up for 11? – Neil – 2017-06-07T10:05:07.840

@Neil I found some better options. I don't know if there are enough whitespace characters left to use as token separators. – mbomb007 – 2017-06-07T16:54:43.610

Great! I like to think I got you thinking anyway, even if you didn't use my specific suggestion. – Neil – 2017-06-07T19:51:05.987

@Neil I did use it in an older revision, but it wasn't long before I changed to using I I /. – mbomb007 – 2017-06-07T21:48:41.873

3

Jelly, score 22, 177 bytes

1: Ṇ  : logical NOT. When there is no input, 0 is assumed, so this returns NOT(0)=1
2: ~A~A  : ~ is bitwise NOT and A is absolute value, implicit 0 input
         : 0~ = -1;   0~A = 1;   0~A~ = -2;  0~A~A = 2.
3: 3  : literal 3
4: -ı-²²×-Ḟ:
   -ı-     : literal complex number -1-1j
   ²²×-    : square (2j), then square(-4), then multiply by (×) negative 1 (-) to get 4+0i
   Ḟ       : get the real component, which is 4
5: 5  : literal 5
6: 6  : literal 6
7: 7  : literal 7
8: 8  : literal 8
9: ØDṪ : tail(Ṫ) of list of digits (ØD) to return 9
10: ⁵  : literal 10
11: 11 : literal 11
12: CNCNCNCNCNCNCNCNCNCNCNC : again, 0 is taken as input because there is no input
                            : C is complement and N is negate
                            : so each NC returns 1-(-n)=n+1 and is equivalent to increment, returning 12
13: “>>>>>»L    : encodes "#GlomAbducens" with “>>>>>» then returns the length in characters (13) with L
14: ‘‘‘‘‘‘‘‘‘‘‘‘‘‘   : default input is 0 again, and each ‘ increments it to get 14
15: Ị;Ị;Ị;Ị;Ị;Ị;Ị;Ị;Ị;Ị;Ị;Ị;Ị;Ị;ỊS : default input is 0 again.
                                   : each Ị returns abs(0)<1 = 1
                                   : these are concatenated together with ; then summed with S to get 15
16: ⁴  : builtin literal 16
17: ,,,,,,,,,,,,,,,,,ŒḂŒḊ : Each , is the pair dyad: x,y = [x,y] and x,[y,z] = [x,[y,z]]. 
                          : Thus each , increased the depth by 1, then ŒḊ returns the depth: 17
18: 9Ḥ : 9 doubled = 18
19: E+E+E+E+E+E+E+E+E+E+E+E+E+E+E+E+E+E+E : each E returns areallelementsidentical([0]) = 1
                                          : 19 of these are summed with +
20: 44440b44ạ/ : 44440 base 44 = [22,42,0].
               : ạ/ takes the absolute difference of terms: ||22-42|-0| = 20
21: ”TOHH : ”T is the character literal "T". OHH returns its ascii value 84 (O) halved twice (HH) = 21
22: literal 22

Try all at once or Try one at a time (argument is which output you want).

Unused characters:

¡¢£¤¥¦©¬®µ½¿€ÆÇÐÑÞßæçðȷñ÷øœþ !"#$%&'()*.:<=?@BFGIJKMPQRUVWXYZ[\]^_`acdefghijklmnopqrstuvwxyz{|}¶°¹³⁶⁷⁸⁹⁺⁻⁼⁽⁾ƁƇƊƑƓƘⱮƝƤƬƲȤɓƈɗƒɠɦƙɱɲƥʠɼʂƭʋȥẠḄḌẸḲḶṂỌṚṢṬỤṾẈỴẒȦĊĖḞĠḢİĿṀṄȮṖṘṠẆẊẎŻḅḍẹḥịḳḷṃṇọṛṣṭụṿẉỵẓȧḃċḋėḟġḣŀṁṅȯṗṙṡṫẇẋẏż«’

fireflame241

Posted 2017-06-03T12:59:09.773

Reputation: 7 021

You're using A for both 2 and 4, no? – Dennis – 2017-06-03T22:37:21.113

@Dennis My TIO link was correct, but my explanation was different. Fixed – fireflame241 – 2017-06-03T23:37:23.850

3

dc, score 20, 102 bytes

I'm assuming since functions/snippets count and returned values count that leaving the value on the stack counts. Otherwise, since dc has no implicit print and four distinct print commands, the max would be 4. We'll expect a clear stack for each of these, though I guess it only matters for one. Several of these will pollute the stack; top of stack is the value.

1
OOOOO++++a
3
4
5
6
7
8
9
A
B
C
D
E
F
2dd^^
KKKKKKKKKKKKKKKKKz
.000000000000000000X
[,,,,,,,,,,,,,,,,,,,]Z
II-II-I-I--

1 and 3-9 should be obvious. Likewise A-F work for 10-15 regardless of input base. 50 is the code point for ASCII 2, so for 2 we add our output base (10) to itself until we get up to 50 and convert it with a. For 16, we do (2^2)^2. For 17, we use 17 Ks to put the default precision (0, but this number is irrelevant) on the stack and then count the stack depth (z). For 18, we use X to count the fractional digits in .000000000000000000. 19 is a string made up of 19 commas, and then Z returns the length of a string. Finally we do 20 by using I to get our input base (10), and essentially doing (10-10)-(((10-10)-10)-10) or 0-_20.

brhfl

Posted 2017-06-03T12:59:09.773

Reputation: 1 291

3

Pyt, score 18, 91 bytes

1: ⅕¬č
2: 2
3: 3
4: 4
5: 5
6: 6
7: ⅐π⁷∜Ř↑
8: 11+1+1+1+1+1+1+
9: φᵱ~˜²Á
10: 7⬡₉
11: é⁴ƖḋƩ
12: ½⅙*⅟
13: ⅓⅑÷řΠḞ
14: ¾⅛/Ŀ⁻⁻⁻⁻
15: 0!⁺⁺⁺⁺△
16: ⅝⅝-⅝-⌊Åᴇ9√Ṗ⇹-¼⅒≥-
17: ɳ₫Ħ
18: 8⬠₅

Explanation

1: ⅕¬č

Pushes 1/5

Takes the logical inverse of 1/5 (False)

Takes the cosine of that (1) [cos(False cast as an integer)=cos(0)=1]


2: 2

Pushes 2


3: 3

Pushes 3


4: 4

Pushes 4


5: 5

Pushes 5


6: 6

Pushes 6


7: ⅐π⁷∜Ř↑

Pushes 1/7

Pushes π

Raises π to the 7th power

Takes the fourth root of π^7

Pushes [int(1/7),...,int(π^(7/4))] (i.e., [0,1,...,7])

Returns the maximum of that array (7)


8: 11+1+1+1+1+1+1+

Adds eight ones together


9: φᵱ~˜²Á

Pushes φ (the golden ratio - (1+√5)/2=1.618...)

Gets the partition number of 1 (φ cast to an integer)

Negates [1]

Gets the unsigned two's-complement** of [-1] (3) [Due to a mistake in how I implemented this, (-1)˜ returns 3]

Squares [3]

Pushes elements of array onto stack (i.e., pushes 9)


10: 7⬡₉

Pushes 7

Pushes the 7th hexagonal number (92)

Divides by 9 (10) (Python 2-style integer division (i.e., 92/9=10))


11: é⁴ƖḋƩ

Pushes e

Raises e to the 4th power

Casts to an integer (54)

Gets the prime factorization of 54 ([2,3,3,3])

Sums the list (13)


12: ½⅙*⅟

Pushes 1/2

Pushes 1/6

Multiplies (1/12)

Takes the multiplicative inverse of 1/12 (12)


13: ⅓⅑÷řΠḞ

Pushes 1/3

Pushes 1/9

Takes the ceiling of 1/9 (1)

Calculates int(1/(1/3)) (3)

Pushes [1,2,3]

Takes the product of the elements in the list (6)

Returns the 6th Fibonacci number (13) (with F(0)=F(1)=1)


14: ¾⅛/Ŀ⁻⁻⁻⁻

Pushes 3/4

Pushes 1/8

Divides 3/4 by 1/8 (6)

Returns the 6th Lucas number (18)

Decrements 4 times (14)


15: 0!⁺⁺⁺⁺△

Pushes 0! (1)

Increments 4 times (5)

Returns the 5th triangle number (15)


16: ⅝⅝-⅝-⌊Åᴇ9√Ṗ⇹-¼⅕≥-

Pushes 5/8 twice

Subtracts 5/8 from 5/8 (0)

Pushes 5/8

Subtracts 5/8 from 0 (-5/8)

Floors -5/8 (-1)

Takes the absolute value (1)

Calculates 10^1 (10)

Pushes 9

Takes the square root (3)

Raises 3 to itself (3^3=27)

(The stack is now [10,27])

Flips the stack ([27,10])

Subtracts 10 from 27 (17)

Pushes 1/4

Pushes 1/10

Pushes 1/4>1/10 (True)

Subtracts 1 (True cast to an integer) from 17


17: ɳ₫Ħ

Pushes "0123456789"

Interprets as an integer and flips the digits (987654321)

Calculates the Hamming weight of 987654321


18: 8⬠₅

Pushes 8

Pushes the 8th hexagonal number (92)

Divides by 5 (again, Python 2-style integer division (92/5=18))


Try them all online!

mudkip201

Posted 2017-06-03T12:59:09.773

Reputation: 833

I find ⅕ in both 1 and 16, ² in both 9 and 15, and Ʃ in both 11 and 16. – Ørjan Johansen – 2018-01-21T02:09:50.723

Lemme go fix those – mudkip201 – 2018-01-21T02:25:20.043

1Okay, fixed. Now there shouldn't be any duplicates. – mudkip201 – 2018-01-21T02:36:14.033

1Does Pyt use any non-accented letters? I don't think I've ever seen one used in a Pyt program before... – caird coinheringaahing – 2018-04-11T19:49:29.067

By design, it doesn't. – mudkip201 – 2018-04-16T16:21:24.237

3

Perl 6, 26 29 numbers, 309 bytes

!@/!@
τ÷π
³
4
5
6
7
8
9

11
[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]
"{3%%3%3}3"
Int((),(),(),(),(),(),(),(),(),(),(),(),(),())
0xF
৹
ᛮ
⑱
꘡꘩
-	--$_-	--$_-	--$_-	--$_-	--$_-$_
Q|Q.CiRCLED NUMBER TWENTY ONE..UNiPARSE|.lc.EVAL.EVAL
22
٢٣
㉔
^?'~'~^''~''~^^?'~'
۲۶
27
߂߈

Try it online!

A lot of this is made easier by the fact that Perl 6 supports numbers being represented by Unicode. This allows us to do things like substituting the digits of 14 for the technically equivalent digits ۱۴, as long as we don't have byte conflicts in the multi-byte characters.The tradeoff is that all the bitwise operators have to be prefixed by +, which narrows down some of what we can do.

Explanation:

1

!@/!@

Divide the logical not of two anonymous empty state variables to get 1

2

τ÷π

Divide tau by pi. Since tau is 2*pi, this equals 2.

3

³

The unicode character SUPERSCRIPT THREE, which evaluates to 3 when not after another number.

4 through 9

All of these are normal ASCII characters

10


This is the character meaning 10 in Inscriptional Parthian.

11

11

Two 1s concatenated together.

12

[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]

Coercing a list to an int results in the length of the list. +[] == 0 and then +[+[]] == 1. This then adds them together to result in 12.

13

"{3%%3%3}3"

Checks if 3 is divisible by 3, then mods that with 3 to coerce the True to a 1 and concatenates it with another 3.

14

Int((),(),(),(),(),(),(),(),(),(),(),(),(),())

Same as number 12, where coercing a list to an int results in the length of the list.

15

0xF

A hexadecimal literal for 15.

16

BENGALI CURRENCY DENOMINATOR SIXTEEN.

17

RUNIC ARLAUG SYMBOL. Interesting note, this is actually a numeric letter, as opposed to the numeric digits and numeric other I've used so far.

18

PARENTHESIZED NUMBER EIGHTEEN. Actually recognisable as a number for once.

19

꘡꘩

VAI DIGIT's ONE and NINE, making 19.

20

-   --$_-   --$_-   --$_-   --$_-   --$_-$_

Some arithemetic on the topic variable, which is initially set to Nil. These are separated by tabs. This evaluates to 20.

21

Q|Q.CiRCLED NUMBER TWENTY ONE..UNiPARSE|.lc.EVAL.EVAL

I'm quite proud of this one. The uniparse function can take a string and find the unicode character called that, which is neat. However, it conflicts with our earlier calls to Int (or the alternatives Rat or Numeric). So we wrap it in a string (using Quotes with various excess characters) and set the whole thing to lowercase before evaling it. We don't need a single digit number, so we get an appropriate Unicode character and eval it again which yields the 21.

I could have also used the \c[] construct in a string, but I'm using the []s elsewhere.

22

22

An integer literal

23

٢٣

ARABIC-INDIC DIGITs TWO and THREE making 23.

24

CIRCLED NUMBER TWENTY FOUR

25

^?'~'~^''~''~^^?'~'

The unary ? operator coerces '~' to a string, which is then converted to the range [0,1) by ^ and then coerced to the string 0 before being XOR'ed with '' (2) and converted back to a string. We do the same with '' (5) and then concatenate the two together to make the string '25'

26

۲۶

ARABIC-INDIC DIGITs TWO and SIX. What do you mean I've already used these? No-no, these are the EXTENDED versions see? Completely different (at least, byte-wise).

27

27

FULLWIDTH DIGIT's TWO and SEVEN

28

߂߈

NKO DIGIT's TWO and EIGHT

29

ord
q``

Return the value of the byte, which is 29. The function doesn't care about the type of whitespace, so I've used a newline here.

Possible further improvements

I can still use various whitespace characters to separate function from argument, but I can't find any that result in a number and don't conflict with all the letters I've already used (e.g. chars, codes, index, encode.bytes).

I've also used up pretty much all the usable non-conflicting bytes between numeric Unicode characters that Perl 6 recognises.

  • I can free up _ from 20 at the cost of a longer program.
  • I can exchange | for a different character.
  • I have enough characters to declare a variable which would have a default value of Nil, though I don't know what I'd do with it.

Leftover printable characters:

*<>&:;=\#GHJKXZabefghjkmpsuvwyz

Jo King

Posted 2017-06-03T12:59:09.773

Reputation: 38 234

2"To keep it fair, all characters must be encoded using a single byte in the language you choose." – Ørjan Johansen – 2018-07-06T03:44:01.987

@ØrjanJohansen I guess I could changr to a different encoding and post all the bytes individually for each unicode character? It wouldn't change much and make parts of it unreadable... – Jo King – 2018-07-06T03:52:08.737

Well I think it would have been simpler to say bytes couldn't be reused, but I didn't make the challenge, so maybe ask OP. – Ørjan Johansen – 2018-07-06T03:57:23.830

For the record, ¹ also does int coercion – H.PWiz – 2019-12-18T03:50:25.337

3

Befunge-98 (PyFunge), score 20, 89 bytes

!
2
3
4
5
6
7
8
9
a
b
c
d
e
f
y\-.@
11111111111111111++++++++++++++++
'\x12
"\x13"
0gg0g###########################\x14

All are snippets except for 16, which is a full program. Some control characters are present, I've written them in the form \x?? here.

Explanations

1. !

Pop an implicit zero off the empty stack and perform a logical negation to get 1.

2. - 15.

Numeric literals

16. y\-.@

Full program. y is the "Get SysInfo" instruction. The first number dictates whether or not some of the Befunge-98 features have been implemented (details) - by default in PyFunge this is 15. The second number is the cell size in bytes, for which PyFunge returns -1, as it uses arbitrary precision integers. Swapping those numbers and subtracting them gives 16. .@ = output as number then exit.

17. 11111111111111111++++++++++++++++

A mysterious one.

18. '\x12

Pushes the code of character 18 onto the stack.

19. "\x13"

Pushes the string onto the stack. Strings actually get pushed backwards - do not be alarmed!

20. 0gg0g###########################\x14

g gets a character code by coordinates. The first g gets the character at (0, 0), which is 48, the next gets the character at (0, 48), which is 32 (by default, the plane is filled with spaces), and the third gets the character at (32, 0), which is the control character 20.

Unused characters

These are the remaining instructions, none of which appear very useful for creating numbers:

Control flow: <>^v? []_|@;hjklmtqrxz

Input/output: &~.,io

Arithmetic: */%w

Stack: $:un{}

Other: ()=spABCDEFGIHJKLMNOPQRSTUVWXYZ

Unrecognized instructions reflect the IP (yet another control flow operation).

negative seven

Posted 2017-06-03T12:59:09.773

Reputation: 1 931

3

MarioLANG, score 2, 3+925 bytes

It's-a-me, Mario.

1 :

    +
    :

I can count 1 when I see a +, adding 1 to cell0 (which contains 0 by default) and : prints the content of current cell as a number to STDOUT. Then I fall to death. Mamma mia! Kill me online!

2 :

    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    .


With my second life, I can count 2 by -ing on cell0 which goes to 255... then fall to death again :( viewing many many -s during the fall... down to char 2, then . prints the content of current cell to STDOUT as a char. Kill me again!

Since this language has only two output methods, I don't think there is any way to count up to 3... Mario needs to improve.

V. Courtois

Posted 2017-06-03T12:59:09.773

Reputation: 868

(If I am right,) snippets are allowed, and you only need to return an integer. The output method does not matter. – None – 2019-09-14T14:48:41.367

3

Wolfram Language (Mathematica), score 16

#&'
Floor@E
3
4
5
6
7
8
9
DDD=(DD(DD)DD(DD)DD(DD)DD(DD)DD(DD))~D~DD;DD=D~D~D;DDD
11
0!+0!+0!+0!+0!+0!+0!+0!+0!+0!+0!+0!
-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I
Sum[u	u,{u,Pi}]
L|L|L|L|L|L|L|L|L|L|L|L|L|L|L//Length
2 2 2 2

Try it online!

Characters used: !#&'()*+,-/0123456789;=@DEFILPS[]eghilmnortu{|}~

1: #&'
Derivative of the identity function: the constant function that returns 1

2: Floor@E
\$\lfloor e\rfloor\$, where \$e\approx2.7183\$

3-9, 11: Literals

10: DDD=(DD(DD)DD(DD)DD(DD)DD(DD)DD(DD))~D~DD;DD=D~D~D;DDD
\$\frac{\mathrm d}{\mathrm d\textit{DD}}(\textit{DD}^{10})|_{\textit{DD}=\frac{\mathrm dD}{\mathrm dD}}=10(1)^9\$

12: 0!+0!+0!+0!+0!+0!+0!+0!+0!+0!+0!+0!
Add \$0!=1\$ twelve times

13: -I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I-I*I
Subtract \$i*i=-1\$ thirteen times

14: Sum[u u,{u,Pi}]
\$\sum_{u=1}^\pi(u\,u)\$.
Takes \$u\$, incrementing by 1, while \$u\le\pi\$, so the sum is equal to \$1^2+2^2+3^2=1+4+9\$

15: L|L|L|L|L|L|L|L|L|L|L|L|L|L|L//Length
Length (number of arguments) of Alternatives[L,L,...L] (15 Ls in this case)

16: 2 2 2 2
Product of four 2s

attinat

Posted 2017-06-03T12:59:09.773

Reputation: 3 495

2

Jelly, score 13, 36 bytes

1
2
3
4
5
6
7
8
9
10 : ⁷ŒṘLRS
 This gets the literal `'\n'`, gets the length (4, incl quotes), generates a list (`[1, 2, 3, 4]`) and sums all elements.

11 : ⁴ḤÆC
This doubles (`Ḥ`) 16 (`⁴`), then counts all primes less than that (which is 11).

12 : ³DIAU‘V 
This takes 100 (`³`), gets the absolute increments between digits (`DIA`, results in `[1, 0]`), reverses the list, increments all elements and makes a string out of it with `V` (technically, it evals the list `[1, 2]` and feeding Jelly numbers just makes it print 'm as literals).

13 : ⁵+⁵’’’’’’’ 
This just is 10+10-7.

Try it online

steenbergh

Posted 2017-06-03T12:59:09.773

Reputation: 7 772

2

Turtlèd, score 4, 11 bytes

(I got it lower with snippets but then it made the task trivial(er) (answers just being digits) so I rolled it back)

'1
"2
@3,
#4#.

commands explanation:

' - writes to the grid the next character

" - writes to the grid all the characters to the next ", or end of program

@ - sets the char var to the next character in program

, - write the char var on the grid

#foo# - set the string var to foo

. - write the pointed char of the string var. initially the first char

Test them here

Destructible Lemon

Posted 2017-06-03T12:59:09.773

Reputation: 5 908

2

Aceto, score 12 14 16 18 19

The multi-character-snippets are given here in linear form for space reasons.

pi is more than 0; cast to float:

Pwf

Just push the corresponding number:

2
3
4
5
6
7
8
9

Convert the implicit 0 to a character (\0x0), then to a boolean (True), then push it on the stack to the right. Move to the left stack and push a zero back on the main stack (and go there). Go to the right stack, and turn on sticky mode, then move the True back to the main stack twice (and go there). Multiply True with True (1), then implode the string. Because this is quite big, I show it here in the "real" 2D form:

)k*£
]{[
(}
cb

Push 1 twice, then implode:

11¥

Negate the implicit zero (True), push another zero and negate it (True, True), bitwise shift (2), push another 0 and negate it (2, True), cast to integer (2, 1), join top two values as strings ("12"), cast to integer (12):

!0!«0!iJi

Invert the zero (-1), negate it (1), duplicate it twice (1, 1, 1), sum up (1, 2), duplicate (1, 2, 2), sum up (1, 4), duplicate (1, 4, 4), sum up (1, 8), swap (8, 1), duplicate four times (8, 1, 1, 1, 1, 1), sum up all (13):

a~dd+d+d+sdddd+++++

Push a Shift-Out character literal, convert to its codepoint (^N stands for the character at ASCII codepoint 14):

'^No

Push a random number 15 times, then push the stack length:

RRRRRRRRRRRRRRRl

Push e 3 times and integer-divide twice. Do this three times. Then do exponentiation twice:

eee//eee//eee//FF

Decrement 17 times, then absolute value:

DDDDDDDDDDDDDDDDD±

Equality of zero and zero. Memorize this. Load it 18 times. Continue subtracting and queueing (move a value from the bottom of the stack to the top), until we arrive at negative 18, memorize this, load and subtract, load and subtract. Because this is quite big, I show it here in the "real" 2D form:

L-Q-Q-Q-
LQ-Q-Q-Q
LLQ-Q-Q-
LL-Q-Q-Q
LLLLQ-Q-
LLLL-Q-Q
MLLLQ--
=LLL-ML

Increment 19 times:

IIIIIIIIIIIIIIIIIII

Characters still left:

  • 2D movement (assumed useless): <>^vNSEW|_#
  • I/O and unreliable things: ™τ,prtT?
  • Stack operations: ø
  • jumps: $@&j§
  • rest: "%.:;ABCGHKOUVXYZ\`ghkmnquxyz»×€∑

Ideas:

  • Do something with the range commands (e.g. 3z** for 6)

L3viathan

Posted 2017-06-03T12:59:09.773

Reputation: 3 151

2

Java, 1 :(

public class P{ static{ System.out.println("1"); }}

Doug

Posted 2017-06-03T12:59:09.773

Reputation: 37

23Welcome to PPCG! Unless most other challenges, this challenge allows for snippets instead of full programs, so I think you can improve on the score. – Laikoni – 2017-06-04T16:37:54.993

2

JavaScript (ES7), score 17

Credits to ETHproductions and darrylyeo.

""**""
Math.E|NaN
3
C=CSS==CSS;C<<C<<C
5
6
7
8
9
++[[]][+[]]+[+[]]
11
4444444444444444444%44
222>>2>>2
`${{}&{}}xe`&`${{}&{}}xe`
0XF
((((((((((((((((~URL)^(~URL/~URL))/~URL^~URL)/~URL^~URL)/~URL^~URL)/~URL^~URL)/~URL^~URL)/~URL^~URL)/~URL^~URL)/~URL^~URL)/~URL^~URL)/~URL^~URL)/~URL^~URL)/~URL^~URL)/~URL^~URL)/~URL^~URL)/~URL
- -!''- -!''- -!''- -!''- -!''- -!''- -!''- -!''- -!''- -!''- -!''- -!''- -!''- -!''- -!''- -!''- -!''

GOTO 0

Posted 2017-06-03T12:59:09.773

Reputation: 752

Very impressive. Let's see... Math.E|NaN could be Math.E|Math, and all of the {}s would be /~/ (and you don't need the two innermost pairs of parens). Sorry if this isn't really helpful, I'm in golf-the-charset mode :P – ETHproductions – 2017-06-04T19:29:13.190

You could probably save a gajillion bytes if you swapped 4 and 16, btw – ETHproductions – 2017-06-04T19:30:04.453

Oh wait, you're using . in both 2 and 14 :( – ETHproductions – 2017-06-04T19:31:09.410

Ah... that needs to be fixed. – GOTO 0 – 2017-06-04T19:34:16.157

@JoKing Oops! Fixed. – GOTO 0 – 2018-07-17T20:48:10.050

2

Ruby 1.8.7, 12 13 14 15

Ruby's strict typing makes this one pretty difficult...

+1 number from GB.

$$**($$-$$)
2
%q{%d}%Math::PI
4
5
6
7
8
9
"size..size".size
11
3+3+3+3
?\r
'==============~'=~/~/
0xF

Value Ink

Posted 2017-06-03T12:59:09.773

Reputation: 10 608

8I'm not familiar with Ruby. What's the reason for using 8 to make 2 and 2 to make 8? – D Krueger – 2017-06-05T12:27:33.707

@DKrueger I was messing around with my numbers so much that it eventually ended up that way, but is completely unnecessary. – Value Ink – 2017-06-05T18:24:53.733

in REPL the value of $. is 1, then you could use the =~ operator to make 15 (like 'verylongstring'=~/x/) – G B – 2017-06-06T10:54:28.457

@GB Using $. robs me of using .size for 14. Although, I just realized that I'm doing a lot of unnecessary stuff in my calculation of 1. – Value Ink – 2017-06-06T18:49:46.437

Maybe using $$**($$-$$) for 1 can help? – G B – 2017-06-07T08:16:35.650

@GB yep, that one works! – Value Ink – 2017-06-07T20:38:57.547

surely you mean ?\r.ord – Asone Tuhid – 2018-01-20T23:56:16.880

2

C#, 12 (35 bytes) 13 (74 68 62 bytes)

Math.E/Math.E
2
3
4
5
6
7
8
9
-~-~-~-~-~-~-~-~-~-~new long()
11
0xC
'N'%'A'

Try it here.

  • Math.E divided by itself results in 1
  • new long() is 1, and the -~s increases this to 10
  • 0xC is hexadecimal for 12
  • 'N' = 78 and 'A' = 65, and 78 modulo 65 is 13

Kevin Cruijssen

Posted 2017-06-03T12:59:09.773

Reputation: 67 575

2

Perl 5, score 19, 234 bytes

Whilst some of the items are the same as @Full Decent's answer I added many and didn't utilise the fact that $_ would be preinitialised to a value because of the script being executed.

Note: for 10, that is a literal newline in the quotes.

__LINE__
2
3
//- -//- -//- -//
int$]
6
7
8
9
ord"
"
11
m<>+m<>+m<>+m<>+m<>+m<>+m<>+m<>+m<>+m<>+m<>+m<>
(555555555555&555555555)%55
push@W,W,W,W,W,W,W,W,W,W,W,W,W,W,W
0xF
4*4
VQ^gf
yyyyyyyyyyyyyyyyyy=~y~y~~
eval''.eval''.lc'MAP{P}H..Z'

Dom Hastings

Posted 2017-06-03T12:59:09.773

Reputation: 16 415

Very fun! What a solid answer. – William Entriken – 2017-08-23T03:04:22.463

2

Brain-Flak, score 1, 2 bytes

()

Try it online!

Snippet that evaluates to 1. You can't go any further.

Erik the Outgolfer

Posted 2017-06-03T12:59:09.773

Reputation: 38 134

10/10. or really (()()()()()()()()()())/(()()()()()()()()()()) – Christopher – 2017-08-20T22:39:37.400

@2EZ4RTZ / isn't something Brain-Flak has... – Erik the Outgolfer – 2017-08-21T08:14:23.527

As in 10 out of 10. – Christopher – 2017-08-21T11:49:52.080

2

Implicit, score 18, 118 bytes

ö
###
3
2^
5
6
7
8
9
10
la-
zA/zA/zA/zA/zA/zA/zA/zA/zA/zA/zA/zA/Þ
OB_
..............
óóóóóóóóóóóóóóó]
4*4
ìé%éééééé
=:+:::::::::++++++++

All these rely on implicit output.

  1. ö pushes iswhole(input). Input is 0 when the input field is left blank, and 0 is whole.
  2. ### pushes the length of the stack, then the length of the stack, then the length of the stack.
  3. 3 pushes 3.
  4. 2^ pushes 2 and squares it..
  5. 5 pushes 5.
  6. 6 pushes 6.
  7. 7 pushes 7.
  8. 8 pushes 8.
  9. 9 pushes 9.
  10. 10 pushes 10.
  11. la- pushes the character codes for l and then a and subtracts them.
  12. zA/ yields 1, repeated 12 times yields a stack with 12 instances of 1. Þ sums them all.
  13. OB_ pushes the character codes for O and B and performs modulo on them.
  14. .............. increments 0 14 times.
  15. óóóóóóóóóóóóóóó] increments the notepad 15 times and pulls it.
  16. 4*4 pushes 4, multiplies it by 4.
  17. ìé%éééééé pushes 0 as a string, increments all char codes by 1, prints, increments by 6.
  18. =:+:::::::::++++++++ pushes 1, duplicates, adds, then does a bunch of duplication/addition.

MD XF

Posted 2017-06-03T12:59:09.773

Reputation: 11 605

2

Julia 0.7/0.6, Score: 13 (83 bytes)

pi\pi
T=[true true]*[true;true];T[true]
3
4
5
gamma(2^2)
7
8
9
0xA|0
11
6+6
'O'-'B'

Obtains 2 via matrix multiplication of Booleans. For 6, we use the gamma (Γ) function (gamma(n) == factorial(n-1)). For 10, 0xA has to be |-ed with 0 since we want the output in decimal notation, not hexadecimal.

I wrote it for Julia 0.7, but it works in Julia 0.6 too without a hitch.

Let me know if there are ways to go beyond 13 (or if I've made some mistake by repeating a character anywhere here).

sundar - Reinstate Monica

Posted 2017-06-03T12:59:09.773

Reputation: 5 296

2

05AB1E, score 48 49, 685 bytes

X
Y
žqò
4
5
6
7
8
9
T
11
∞ćìć
≠ˆ≠≠ˆ≠≠ˆ≠≠ˆ≠≠ˆ≠≠ˆ≠≠ˆ≠≠ˆ≠≠ˆ≠≠ˆ≠≠ˆ≠≠ˆ≠≠ˆ¯≠≠βΩ
ŽŽŽttî
¶∊∊∊¶¢
‹oooo
AaĆĆĆAaĆĆ&R
‘I‘C
@ØØØ
›°°x
•L
22
Ê>>>>>>>>>>>>>>>>>>>>>>>
‚‚˜œāθ
₅Ô
₂
$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—$—O
₁hhhh
0±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä±Ä
’U’Î\ö
₄;;;;;ï
Q·····
33
dd+++++õdd+õdd+
¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¼¾
₆
ËŠËŠËJf`
ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªvN
šššššššššššššššššššššššššššššššššššššššg
ĀD(-D(-D(-DD(-D(-(-
“ÙÙÙÙÙÙk““k“k
”*”ÇM
Ƶó¦
®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®Æ
__ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ)ƶ¤
ΘÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ
₃<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
тÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
' HÂ

Try it online!

Still improvable, but 48 is enough to beat Jelly's 47.

The test bench messes up snippet 40, so here's 40 as a standalone program.

Grimmy

Posted 2017-06-03T12:59:09.773

Reputation: 12 521

1

Pyth, score 18, 207 bytes

.!0
2
3
4
5
6
7
8
C\  
T
11
s[JsP9J
++++++++++++KqkkKKKKKKKKKKKK
-------------gZZ_gZZ_gZZ_gZZ_gZZ_gZZ_gZZ_gZZ_gZZ_gZZ_gZZ_gZZ_gZZ_gZZ
hhhhhhhhhhhhhh!Y
yyyy^>bb>bb
a<ddttttttttttttttttt<dd
l"llllllllllllllllll

Test suite

Any help welcome although I won't respond immediatly, so feel free to edit.

KarlKastor

Posted 2017-06-03T12:59:09.773

Reputation: 2 352

@totallyhuman Or maybe even l"llllllllllllll – Okx – 2017-06-04T09:32:48.647

1

Chip, score 1

t*ae*f

Yep, only 1.

The above code (plus at least one of the flags -w, -z, or -o) outputs the value 0x31, which is the ascii code point for the digit '1', then terminates itself:

t        If active, terminate execution after printing the current output byte
 *       Activate neighboring elements
  a      If active, set output bit 0x01 to 1
   e     If active, set output bit 0x10 to 1
    *    Activate neighboring elements
     f   If active, set output bit 0x20 to 1

Since e and f are required in order to output every digit (as they are the only way to set those bits), we can't go any higher than a single digit.

Phlarx

Posted 2017-06-03T12:59:09.773

Reputation: 1 366

1

Fission 2, Score: 2, 10 bytes

1: R'1!;

2: *"2"L

Try it online!

As far as I know, this is as high as you can possibly get in Fission, as the program has to start at one of RLUD characters, and you have to use " or ! to output

In hindsight this can probably be improved by taking advantage of Snippets are allowed!

Explanation

1:

R'1!;
R       Spawn atom with 1 mass, 0 energy, moving right
 '1     Set atom's mass to ASCII value of 1
   !    Print character represented by atom's mass
    ;   Destroy atom

2:

*"2"L
    L   Spawn atom with 1 mass, 0 energy, moving left
   "    Enter printing mode, print all chars atom moves over
  2     Print 2
 "      End printing mode
*       Terminate program

Skidsdev

Posted 2017-06-03T12:59:09.773

Reputation: 9 656

1

><>, Score 2, 8 Total Bytes

Can't go any higher, there are only 2 output commands: n for numbers, and o for characters.

1n;

Prints 1, as a number.

'2'ov

Pushes 2's ascii value to the stack. Prints it as a character. Loops forever, since there's no way to end the program without re-using a semicolon.

Bolce Bussiere

Posted 2017-06-03T12:59:09.773

Reputation: 970

There's a ><> answer already, which does a lot better since answers can be "snippets".

– Ørjan Johansen – 2017-11-18T18:56:07.590

Ah, I see. Oh well ¯_(ツ)_/¯ – Bolce Bussiere – 2017-11-18T19:30:55.910

Also, you can end the program using any non-instruction, dividing by 0 or doing any instruction without a sufficient amount of items in the stack – Jo King – 2017-12-30T12:41:53.770

Also, I think you dropped this: \ – mudkip201 – 2018-01-21T02:40:10.407

1

C (clang), 50 bytes, score 13

!NULL
2
3
4
5
6
7
8
9
1e1
'l'-'a'
0xC
*"\r"

Try it online!

Logern

Posted 2017-06-03T12:59:09.773

Reputation: 845

@ØrjanJohansen Fixed – Logern – 2018-11-07T03:43:59.307

@JoKing fixed, but it loses one number. – Logern – 2018-11-07T14:05:08.897

Up to 15, if I didn't make mistakes. – None – 2018-11-13T16:33:49.503

Optionally, if <float.h> isn't considered boilerplate enough, RAND_MAX>>SEEK_END>>...>>SEEK_END/SEEK_END will obtain the same result, and are from <stdlib.h> and <stdio.h>. – None – 2018-11-13T16:51:21.183

1

(K+R)eg, score 32

Our task is to write as many programs / functions / snippets as you can, where each one outputs / prints / returns an integer. The integer is already on the stack, so it should have already returned the integer. The method of outputting does not matter.

  • 1-9 implicit outputs the respective integer. We are using control characters for this. In order to save the 1 character, we should do \x03\x02> instead.
  • 10(TIO):
\

  • 11-31 Yes, you need control characters! In order to return a specified number, you only need to convert the integer to its ASCII character form. Unfortunately this is in the ASCII range, and implicit integer output does not work.

Returning 13 is a special case(TIO):

;
  • 32 Great, so this is automatically pushed onto the stack.

So I can't think of more methods.

user85052

Posted 2017-06-03T12:59:09.773

Reputation:

2Couldn't you push 33 to the stack by pushing 2 Unicode characters that have a difference of 33, then subtracting? – EdgyNerd – 2019-09-14T16:00:15.887

0

Perl REPL, score 16

Get Perl REPL by using perl -nE'say eval'.

__LINE__
2
3
4
5
6
length
8
9
cos,abs
11
0xC
$.
7+7
!rmdir()+!rmdir()+!rmdir()+!rmdir()+!rmdir()+!rmdir()+!rmdir()+!rmdir()+!rmdir()+!rmdir()+!rmdir()+!rmdir()+!rmdir()+!rmdir()+!rmdir()
//- -//- -//- -//- -//- -//- -//- -//- -//- -//- -//- -//- -//- -//- -//- -//

Other things I tried:

(ord Z)-(ord K)

And here are some ideas of how to cheat:

  • umask
  • tell
  • getppid
  • getpgrp
  • wait
  • system
  • time
  • srand
  • localtime
  • gmtime
  • ls|wc -l <---- cheating, has preconditions

William Entriken

Posted 2017-06-03T12:59:09.773

Reputation: 175

There's a lot more that can be done here – William Entriken – 2017-06-05T15:32:26.563

12>

  • in both 14 and 15.
  • < – Ole Tange – 2017-06-05T15:50:22.783

    3I feel that $. is cheating, as it would not work without the previous commands having run. I'd consider it acceptable in the first spot only. – Ørjan Johansen – 2017-06-05T17:27:56.940

    There's a + in both your 14 and your 15. – Erik the Outgolfer – 2017-08-21T11:57:21.357

    0

    Unreadable, score 1, 150 4 bytes

    '"""
    

    Try it online!

    -146 bytes because snippets are allowed

    Returns 1

    Skidsdev

    Posted 2017-06-03T12:59:09.773

    Reputation: 9 656

    0

    Microscript II, score 13 (33 bytes)

    e
    2
    3
    4
    5
    6
    7
    8
    9
    EE
    11
    ssssssssssss#
    "na"Ko-
    

    SuperJedi224

    Posted 2017-06-03T12:59:09.773

    Reputation: 11 342

    0

    ArcPlus, score 1, 4 bytes [non-competing]

    (p 1
    

    Prints 1

    Skidsdev

    Posted 2017-06-03T12:59:09.773

    Reputation: 9 656

    0

    Pain-Flak, Score 1

    ))((}{

    Try it online!

    Christopher

    Posted 2017-06-03T12:59:09.773

    Reputation: 3 428

    0

    Whitespace, score 1, 5 bytes

         
    
    

    or perhaps more readable (where S are spaces, T are tabs, and N are newlines):

    SSSTN
    

    Try it online.

    Explanation:

    Whitespace only has three available characters: spaces, tabs, and newlines (with unicode values 32, 9, and 10 respectively), every other character is ignored. The snippet above will:

    • S: Enable Stack Manipulation
    • S...N: Push the number to the stack
    • S: A positive number (T would have been negative)
    • T: Some S and T as binary, where S is 0 and T is 1. So the T is both binary and decimal 1 in this case.

    The footer of the TIO-link is TNST, which will:

    • TN: Enable I/O
    • NT: Print the top of the stack as number to STDOUT

    Kevin Cruijssen

    Posted 2017-06-03T12:59:09.773

    Reputation: 67 575

    0

    ArnoldC, score 1, 57 bytes

    I have a question with this. Would an "ArnoldC snippet" exist? Would it consist of removing IT'S SHOWTIME (beginMain) and YOU HAVE BEEN TERMINATED (endMain)? Would we need to I'LL BE BACK (return)? Anyway, if it doesn't, I can count to ... 1.

    IT'S SHOWTIME
    TALK TO THE HAND 1
    YOU HAVE BEEN TERMINATED
    

    Try it online!

    V. Courtois

    Posted 2017-06-03T12:59:09.773

    Reputation: 868

    2A snippet removes the boilerplate stuff that's needed for every programs/functions. – None – 2019-09-14T22:06:57.037

    @A_ I should be studying the chars I used then :) Thanks for your comment on this answer (and on the mariolang one too). – V. Courtois – 2019-09-25T08:30:11.740