95 languages (all characters used!)
(TODO: a couple more answers that I have planned out but not implemented)
1. COBOL - forbids A
PROGRAM-ID.g.PRODECURE DIVISION.DISPLAY"Ununtrium".
Prints Ununtrium
.
2. REBOL - forbids B
REBOL[]prin"Tellurium"
Prints Tellurium
.
3. bc - forbids ^
a=0^0
"Strontium"
Prints Strontium
.
4. D - forbids D
void main(char[][]D){printf="Ruthenium";}
Prints Ruthenium
.
5. Java - forbids E
enum E{E;{System.out.print("\x41luminium");}}
Prints Aluminium
.
6. Scala - forbids F
val F=print("Plutonium")
Prints Plutonium
.
7. Rust - forbids G
fn main(){let G:u8;print("\x41mericium")}
Prints Americium
.
8. Nim - forbids &
discard 0&0
echo "Neptunium"
Prints Neptunium
.
9. C# - forbids C
class V{static void Main(){System.Console.Write("Neodymium");}}
Prints Neodymium
.
,1 1.%vv"Manganese"Q
Prints Manganese
.
11. Nemerle - forbids I
Nemerle.IO.print("Magnesium")
Prints Magnesium
.
12. Ada - forbids J
procedure gnat.io.J is begin put("Palladium");end;
Prints Palladium
.
13. Go - forbids |
package main
func main(){if 1|1>0{print("Germanium")}}
Prints Germanium
.
14. K - forbids ```
`0:"Ytterbium"
Prints Ytterbium
.
15. Erlang - forbids /
-module(test).
-export([m/0]).
m()->io:put_chars("\x42eryllium").
Prints Beryllium
.
16. Prolog - forbids :
m:-write('\102erkelium').
Prints Berkelium
.
17. Smalltalk - forbids K
K:=0.'Lanthanum'display
Prints Lanthanum
.
18. PARI/GP - forbids L
print(Potassium)
Prints Potassium
.
19. REXX - forbids M
M=0
say "Tungsten"
Prints Tungsten
.
20. LilyPond - forbids N
#(let((N 0))(print"\x46levorium"))
Prints Flevorium
.
21. Arc - forbids Q
(let Q 1(pr "\x41ntimony"))
Prints Antimony
.
22. Common LISP - forbids R
(let((R 0))(princ"Tantalum"))
Prints Tantalum
.
23. Clojure - forbids U
(def U)(pr'Selenium)
Prints Selenium
.
24. Logo - forbids Z
to Z
end
pr[Scandium]bye
Prints Scandium
.
25. Groovy - forbids W
print"Samarium";W=0
Prints Samarium
.
26. Asymptote - forbids X
write('\x52ubidium');int X=0;
Prints Rubidium
.
27. Octave - forbids Y
Y=0;disp Yttrium
Prints Yttrium
.
28. gnuplot - forbids V
V=0;prin"Vanadium
Prints Vanadium
.
29. Kite - forbids z
z=0;"\x4eobelium"|print;
Prints Nobelium
.
30. Squirrel - forbids _
print("\x4eitrogen");local _=0;
Prints Nitrogen
.
31. Curry - forbids v
v=v;main=putStr"\x4cutetium"
Prints Lutetium
.
32. Fortran - forbids q
q=0;print'("Thallium")';end
Prints Thallium
.
33. Pascal - forbids l
begin;var l:integer;write(#70#114#97#110#99#105#117#109)end.
Prints Francium
.
34. PHP - forbids k
<?=$k="\70\108\117\111\114\105\110\101";
Prints Fluorine
.
35. Haskell - forbids S
main=putStr"Sodium"
Prints Sodium
.
36. C++ - forbids ~
#include<cstdio>
main(){~puts("\x41ctinium");}
Prints Actinium
.
37. ObjC - forbids j
main(j){puts("Hydrogen");}
Prints Hydrogen
.
38. Lua - forbids g
print("\65statine")
Prints Astatine
.
39. JavaScript - forbids b
alert("\x43h\x6corine")
Alerts Chlorine
.
40. Bash - forbids h
echo Osmium
Prints Osmium
.
41. Cyan - forbids o
say"Hassium"
o=0
Prints Hassium
.
42. J - forbids d
wd'Titanium'
Prints Titanium
.
43. Scheme - forbids x
(let((x 0))(print"Vana\x64ium"))
Prints Vanadium
.
44. C - forbids {
main(){puts("\x55ranium");}
Prints Uranium
.
45. FORTH - forbids m
84 emit
104 emit
111 emit
114 emit
105 emit
117 emit
109 emit
Prints Thorium
.
46. BASIC - forbids T
T$="Tin"
?T$
Prints Tin
.
47. Perl 6 - forbids y
say "\o124\o145\o162\o142\o151\o165\o155"
Prints Terbium
.
48. Asdf - forbids a
asaasaasssasaasssassaasaasssaasaasssaasaasssaasaasssaasaasssasaasssassaasaasssasaasssassasaasssassasaasssassaasaasssaasaasssasaasssassaasaasssaasaasssasaasssassasaasssassasaasssassaasaasssaasaasssasaasssassasaasssassaasaasssasaasssassasaasssassaasaasssaasaasssasaasssassaasaasssasaasssassaasaasssasaasssassasaasssassaasaasssasaasssassasaasssassasaasssassaasaasssaasaasssasaasssassasaasssassaasaasssasaasssassaasaasssaasaasssasaasssassaasaasssasaasssassasaasssassaasaasssaasaasssaasaasssasaasssassasaasssass
Prints Arsenic
. Generating script.
49. Tcl - forbids s
puts "\123\151\154\151\143\157\156"
Prints Silicon
.
50. Perl - forbids ;
print"\122\150\157\144\151\165\155";
Prints Rhodium
.
51. Python - forbids r
print"\103\150\162\157\155\151\165\155"
Prints Chromium
.
52. WARP - forbids =
=nn0(82(104(110(105(117(109
Prints Rhenium
.
53. ETA - forbids n
nnOtOe nHHOne enenteht O
nnHHHe nHHtOe enenteht O
nntOHe nHHtne enenteht O
nnHnHe nHHtne enenteht O
nntnte nHHtne enenteht O
nHOHne nHHHte enenteht O
Prints Bromine
.
54. Axo - forbids \
99*3+(94+8*('u'(93+9*(35*7*('fu'(7+(\
Prints Thulium
.
55. Ruby - forbids t
putc 69
putc 117
putc 114
putc 111
putc 112
putc 105
putc 117
putc 109
Prints Europium
.
56. DBFV! - forbids u
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u6 u>
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u6 u>
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u3 u>
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u8 u>
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u6 u>
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 u>
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u6 *u4 u>
Prints Niobium
. Each space is actually a newline.
57. Mouse - forbids '
77 !' 101 !' 114 !' 99 !' 117 !' 114 !' 121 !'
Prints Mercury
.
58. Word - forbids f
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
Prints Cadmium
.
59. Ftack - forbids $
H 109 117 105 104 116 105 $ 1 76
Prints Lithium
.
60. WASD - forbids e
We introduce the concept of the trivial Brainfuck solution (TBS): we can print any character in 257 Brainfuck commands by incrementing the accumulator c times, outputting, then incrementing it (256-c) more times to reset it. Repeating this for each character in the string yields the solution. Whenever we have two subprograms i
and o
that function exactly like Brainfuck's +
and .
, we call the translated TBS the (i
, o
)-TBS.
Instead of wrapping around we might be able to set the accumulator to zero after printing using some subprogram o'
. This is the (i
, o'
)-zeroing TBS.
Alternatively, we might have no wrapping but a subprogram d
that decrements the accumulator. This is a the (i
, o
, d
)-TBS.
For WASD a (w
, e
)-TBS prints Silver
.
61. URSL - forbids w
A (i1
, w1
, c1
)-TBS prints Krypton
.
#73#114#105#100#105#117#109
Prints Iridium
.
63. Owl - forbids ?
0[]?83)117)108)102)117)114)
Prints Sulfur
.
64. RUBE - forbids )
+ + + +
8478 666 667 6965767 6 )
cccccccccccccccccccccccc
........................
O
c
.
Prints Holmium
.
A ((
, "
)-TBS prints Bohrium
.
66. FALSE - forbids [
[]!71,97,108,105,117,109,
Prints Gallium
.
,-,++66,-,+8,+5,+*55,*8958
Prints Hafnium
.
68. Kipple - forbids >
70>o 101>o 114>o 109>o 105>o 117>o 109>o
Prints Fermium
.
68]117]98]110]105]117]109]""^
Prints Dubnium
.
67"P.97"P.108"P.99"P.105"P.117"P.109"P.
Prints Calcium
.
A (PpP
, PPp
)-TBS prints Bismuth
.
72. dc - forbids P
67P97P100P109P105P117P109P
Prints Cadmium
.
82O97O100O105O117O109O
Prints Radium
.
TODO
Prints Cobalt
.
75. Vrejvax - forbids <
TODO
Prints Cerium
.
76. Fueue - forbids H
80 111 108 111 110 105 117 109 H
Prints Polonium
.
77. Pi - forbids 6
Run bf2pi
from the wiki article on a trivial Brainfuck solution to print Xenon
.
78. CJam - forbids 5
A (1+
, c 0
)-zeroing TBS (with 0
prepended) prints Nickel
.
A (9999
, 99
)-TBS prints Carbon
.
≈ 3^(257*4*3) sevens
See 91-94 (use only 7
.) Prints Radon
.
TODO
Prints Barium
.
A (1
, 8
)-TBS prints Iodine
.
A (2
, 3
)-TBS prints Indium
, but 2
decrements instead of incrementing, so subtract each character code from 256 first.
1 1 1
2 1 2 2 2 2 2 1
2 1 1 1 2 2 1 2
2 1 1 2 2 1 1 1
2 1 1 2 1 1 1 1
2 1 1 2 1 1 1 2
Prints Argon
.
Prepending 0
to a (1+
, ,0
)-zeroing TBS, and appending @
, prints Helium
.
86. Whirl - forbids 1
Prepending One Load Zero
to an (Add
, AscIO Zero
)-zeroing TBS prints Boron
.
A (-
, ,
)-TBS prints Erbium
.
A (+
, .
)-TBS prints Curium
.
An (i
, c
)-TBS prints Copper
.
90. Iota - forbids i
We compute a Church-numeral base-256-decoding to Zinc
to make up for Iota's lack of IO. Define
succ = ***i*i*i*ii***i*i*i*ii**i*i*ii*i*i*i*ii*i*i*ii
Then the solution is 1516858978 repetitions of succ
followed by *ii
, for a total length of 69775512991 bytes.
Unary-like programs
The following four solutions (and 70) are similar: they all consist of approximately 3^(257*4*3) repetitions of the character they forbid (except Ellipsis is thrice as long). The exact value is decided by converting the TBS to octal as described on the wiki.
≈ 3^(257*4*3+1) periods
Prints Neon
.
≈ 3^(257*4*3) exclamation marks
Prints Lead
.
93. MGIFOS - forbids *
≈ 3^(257*4*3) asterisks
Prints Iron
.
94. Unary - forbids 0
≈ 3^(257*4*3) zeros
Prints Gold
.
The Whitespace program generated by this Python script:
import sys
for c in 'Oxygen':
print ' ' + ''.join(' \t'[int(b)] for b in bin(ord(c))[2:])
sys.stdout.write('\t\n ')
print '\n\n'
prints Oxygen
.
cout<<"Hydrogen";
in C++? Do we need to includeinclude
s in the code? Does a program need to print a newline after the name of the element? \$\endgroup\$