No strings (or numbers) attached If you like this, consider participating in:


The Official Dyalog APL 2016 Year Game
The monthly Dyalog APL 2017 Code Golf Challenge




Make 12 snippets/expressions, in the same language, that result in the numbers 0 through 10, and 42 respectively, but without writing any literal numeric, string, or character data.

Build-in data, like PI() and ALPHABET(), are fine, and so are e.g. CJam's U, X, Y, Z, and A constants, and Processing's BLEND, CHORD, CENTER, BREAK, and  LINES.

Every snippet must be able to stand on its own, i.e. they may not be interdependent. However, inside a single snippet, you may assign a variable and use it freely, as long as you refer to it directly by name, and not through a string containing its name.

All the snippets must be valid on the submitter’s computer at the time of submission (as reported by SE), but may not rely on unusual local conditions like number of files in a directory, the exact date or time, or specific input from the user.

Examples of valid snippets

3: INT(LOG10(YEAR(TODAY())))   because it remains true in the foreseeable future
4: CUBICROOT(LEN(CHARACTERSET()))   because a 256 letter character set is very common
8: SQRT(SYSTEMTYPE())   because 64-bit systems are very common

Examples of invalid snippets

5: LEN(USERNAME())   because most people do not use “Admin” as login :-)
9: LOG10(SYSTEMMEMORY())   because it only works on systems with exactly 1 GB of memory
42: CODE("*")   because it contains a string/character literal

The result of each snippet must result in an actual number (value, int, float, etc.) that can be used for further calculations using the same language as the snippet, i.e not a text string representing that number.

Only character based languages allowed. 

Score is total byte count of all the 12 snippets combined. Newlines separating the snippets are not counted in.

Note that the above rules may prevent some languages from participating, even if they are Turing complete.

FAQ

Q Can the programs accept any input?
A Yes, but you may not just ask for input and enter the relevant number.

Q Are physical digits (non-data) digits allowed?
A Yes, e.g. LOG10().

Q Do Symbols in Ruby count as literals?
A Yes.

Q Does score include newlines between each snippet?
A No.

Q Is TI-BASIC "character based" enough to be valid?
A Yes.

Q Do false and true count as number literals?
A No, they are acceptable.

Q Can we use a number literal to call a function if that's the only way and the number doesn't influence the output of the function?
A Yes, if that is the normal way to write code in your language.

Q My language assumes there is a [something] at the start of each program/expression. Must I include it, or should my snippets just work if placed in the middle of a program/expression?
A They should just work in the middle of a program/expression.

Q What about regex literals?
A Forbidden, except for languages that only do regexes.

Q Is one piece of code that could print all the specified numbers acceptable?
A No, they have to be separate and mutually independent.

Q May I assume a boilerplate like int main() {}... or equivalent?
A Yes.

Q What output datatypes are allowed?
A Any numeric datatype, like int, float, etc.

Q Do I need to print the result of each snippet?
A No, making the result available for subsequent use is enough.

Q Are pre-set variables allowed?
A Yes, and they become reset (if changed) for every snippet.

Q Are π and e considered number literals?
A No, you may use them.

Q May I return 4 and 2 in different cells for 42?
A No, they must be connected as one number.

Q Bytes or characters?
A Bytes, but you may choose any desired codepage.

Q May constant functions and preset variables like J's 9:, Actually's 9, and Pretzel's 9 be used?
A Yes, if the vocabulary is finite (19 for J, 10 for Actually and Pretzel).
Funciton, 1222 bytes

Apart from numeric literals, there are two ways I can produce a value (any value at all) in Funciton: stdin and lambda expressions. Stdin is a single box while a full lambda expression requires more syntax, so I’m going with stdin. However, while stdin could be anything, all of the following work regardless of what input is provided.

All of the library functions used here existed before the challenge was posted.

0 (40 bytes in UTF-16)

╔╗┌┐
║╟┤└┼┬┐
╚╝└─┘└┘


This uses the raw syntax for less-than. A value is never less than itself, so the result of this is 0.

1 (52 bytes in UTF-16)

╔╗┌─╖┌─╖
║╟┤⌑╟┤ɕ╟
╚╝╘═╝╘═╝


⌑ returns a lazy sequence containing a single element and ɕ counts the number of elements. (The lazy sequence is lazy enough that this snippet doesn’t actually evaluate stdin at all!)

2 (70 bytes in UTF-16)

╔╗┌─╖┌─╖┌─╖
║╟┤⌑╟┤ʂ╟┤ɕ╟
╚╝╘═╝╘═╝╘═╝


= 2¹. ʂ generates all subsequences of a sequence, and thus turns a sequence of n elements into one with 2ⁿ.

3 (88 bytes in UTF-16)

╔╗┌─╖┌─╖┌─╖┌─╖
║╟┤⌑╟┤ʂ╟┤ɕ╟┤♯╟
╚╝╘═╝╘═╝╘═╝╘═╝


= 2 + 1. ♯ increments a value by 1.

4 (88 bytes in UTF-16)

╔╗┌─╖┌─╖┌─╖┌─╖
║╟┤⌑╟┤ʂ╟┤ʂ╟┤ɕ╟
╚╝╘═╝╘═╝╘═╝╘═╝


= 2².

5 (106 bytes in UTF-16)

╔╗┌─╖┌─╖┌─╖┌─╖┌─╖
║╟┤⌑╟┤ʂ╟┤ʂ╟┤ɕ╟┤♯╟
╚╝╘═╝╘═╝╘═╝╘═╝╘═╝


= 4 + 1.

6 (106 bytes in UTF-16)

╔╗┌─╖┌─╖┌─╖┌─╖┌─╖
║╟┤⌑╟┤ʂ╟┤ɕ╟┤♯╟┤!╟
╚╝╘═╝╘═╝╘═╝╘═╝╘═╝


= 3 factorial.

7 (110 bytes in UTF-16)

┌───┐┌─╖┌─╖┌─╖╔╗
│┌─╖├┤ɕ╟┤ʂ╟┤⌑╟╢║
└┤A╟┘╘═╝╘═╝╘═╝╚╝
 ╘╤╝


= A(2, 2) (Ackermann function).

8 (118 bytes in UTF-16)

┌────┐┌─╖┌─╖┌─╖╔╗
│┌──╖├┤ɕ╟┤ʂ╟┤⌑╟╢║
└┤&lt;&lt;╟┘╘═╝╘═╝╘═╝╚╝
 ╘╤═╝


= 2 &lt;&lt; 2 (shift-left).

9 (128 bytes in UTF-16)

┌───┐┌─╖┌─╖┌─╖┌─╖╔╗
│┌─╖├┤♯╟┤ɕ╟┤ʂ╟┤⌑╟╢║
└┤×╟┘╘═╝╘═╝╘═╝╘═╝╚╝
 ╘╤╝


= 3 × 3.

10 (146 bytes in UTF-16)

┌───┐┌─╖┌─╖┌─╖┌─╖┌─╖╔╗
│┌─╖├┤♯╟┤ɕ╟┤ʂ╟┤ʂ╟┤⌑╟╢║
└┤+╟┘╘═╝╘═╝╘═╝╘═╝╘═╝╚╝
 ╘╤╝


= 5 + 5.

42 (170 bytes in UTF-16)

┌──────┐┌─╖┌─╖┌─╖┌─╖┌─╖╔╗
│┌─╖┌─╖├┤!╟┤♯╟┤ɕ╟┤ʂ╟┤⌑╟╢║
└┤♯╟┤×╟┘╘═╝╘═╝╘═╝╘═╝╘═╝╚╝
 ╘═╝╘╤╝


= 6 × (6 + 1).