| Bytes | Lang | Time | Link |
|---|---|---|---|
| 029 | Bespoke | 250827T032809Z | Josiah W |
| 003 | iogii | 241110T183852Z | Unrelate |
| 005 | Alice | 241109T201741Z | Julian |
| 012 | Ruby | 160820T015443Z | Jordan |
| 016 | Zsh | 241029T005559Z | roblogic |
| 021 | AWK | 241028T170234Z | xrs |
| 004 | Uiua | 240729T194029Z | Europe20 |
| 035 | Setanta 0.3.3 | 240720T231047Z | bb94 |
| 048 | Messenger | 240723T180628Z | squarero |
| 009 | Rattle | 240723T170712Z | d01 |
| 015 | Bash | 160820T005230Z | Digital |
| 007 | Kotlin | 240721T011343Z | Barry Fr |
| 023 | JavaScript Node.js | 240718T044350Z | Andrew B |
| 012 | YASEPL | 240208T203927Z | madeforl |
| 025 | Google Sheets | 240128T001249Z | z.. |
| 001 | Vyxal 3 g | 240127T212134Z | pacman25 |
| nan | Piet + asciipiet | 220705T051453Z | Bubbler |
| nan | 230615T073259Z | Dadsdy | |
| 010 | Deadfish~ | 230614T213401Z | Wallace |
| 032 | Python | 230415T212907Z | Joao-3 |
| 024 | Mathematica | 160820T034720Z | Greg Mar |
| 022 | C89 | 230412T161739Z | c-- |
| 017 | Python 3 | 230412T152319Z | The Empt |
| 007 | GolfScript | 230124T153641Z | emirps |
| nan | Fig | 230112T194036Z | Seggan |
| nan | 230112T173611Z | The Thon | |
| 014 | K ngn/k | 230110T055726Z | doug |
| 018 | Aheui esotope | 230110T045025Z | Bubbler |
| 017 | Python 2 | 221230T200744Z | joyofori |
| nan | J | 181130T192147Z | Jonah |
| nan | Fig | 221210T021348Z | south |
| 033 | Kustom | 221209T213330Z | Leaf |
| 047 | HTML5 | 201107T175430Z | Samathin |
| 006 | Straw | 160912T221711Z | TuxCraft |
| 015 | Risky | 210618T142026Z | a stone |
| 008 | Flobnar | 220712T090304Z | Bubbler |
| 007 | PostScript | 220705T141031Z | bartysla |
| 026 | k ngn/k | 220217T170234Z | sugarfi |
| 009 | StupidStackLanguage | 220113T001700Z | whqwert |
| 033 | Python 3 | 220110T163015Z | Alan Bag |
| 017 | KonamiCode | 211112T144304Z | Ginger |
| 016 | PICO8 | 211107T170357Z | weatherm |
| 009 | Lean Mean Bean Machine | 181130T165533Z | Mayube |
| 015 | Excel | 210319T124029Z | Axuary |
| 009 | Knight | 210618T135801Z | EasyasPi |
| 006 | Pxem | 210618T125616Z | user1004 |
| 012 | Factor | 210503T021539Z | chunes |
| 002 | Vyxal | 210503T020106Z | Aaroneou |
| 909 | Pxem | 210319T142524Z | user1004 |
| 007 | TeX | 210319T134614Z | plante |
| 012 | Nim | 210319T131631Z | Adam |
| 007 | Befunge93 | 210319T105315Z | Redy000 |
| 001 | BRASCA | 210319T095502Z | SjoerdPe |
| 024 | Python 3 | 191224T133920Z | Sagittar |
| 013 | Bash | 160828T090319Z | seshouma |
| 019 | Brainfuck | 160819T222719Z | Cody |
| 009 | Groovy | 160822T065314Z | M. Justi |
| 005 | MAWP | 200820T160759Z | Razetime |
| 108 | Whispers v2 | 200820T155824Z | caird co |
| 006 | x8616 machine code | 200624T174222Z | 640KB |
| 015 | Google Sheets/Excel | 200620T190033Z | General |
| 141 | Brainetry | 200613T172339Z | RGS |
| 008 | International Phonetic Esoteric Language | 190930T035611Z | bigyihsu |
| 020 | Python | 200124T143739Z | Hunaphu |
| 016 | Ruby | 200124T154013Z | IMP1 |
| 324 | Lenguage | 181206T130943Z | Kevin Cr |
| 033 | Wenyan | 191229T144855Z | Shieru A |
| 041 | Wren | 191226T150957Z | user8505 |
| 004 | Pip | 191227T054353Z | DLosc |
| 004 | 05AB1E | 191224T210031Z | Sagittar |
| 015 | BBC Basic IV | 191225T210554Z | Richard |
| 002 | W d | 191224T134836Z | user8505 |
| 012 | Julia 1.0 | 190930T163359Z | gggg |
| 001 | Keg | 190930T030911Z | lyxal |
| 028 | BrainFlak | 190918T172230Z | Dorian |
| 007 | Brian & Chuck | 190918T171844Z | Dorian |
| 006 | Runic Enchantments | 190918T152219Z | Draco18s |
| 032 | Keg | 190608T051517Z | user8505 |
| 004 | Number Factory | 190609T000157Z | Esolangi |
| 016 | AppleScript | 190608T134623Z | a stone |
| 009 | Java 8 | 190310T225826Z | Benjamin |
| 003 | !@#$%^&*_+ | 190310T231743Z | Conor O& |
| 002 | MathGolf | 181206T124245Z | Kevin Cr |
| 002 | MathGolf | 181129T170437Z | Jo King |
| 038 | Scratch | 181202T082816Z | W. K. |
| 006 | Ahead | 181202T071126Z | snail_ |
| 019 | MBASIC | 181130T204201Z | wooshiny |
| 044 | C# .NET Core | 181129T163743Z | Meerkat |
| 007 | Kotlin | 181130T175909Z | snail_ |
| 021 | Aheui esotope | 181130T082552Z | cobaltp |
| 002 | Japt g | 181129T135521Z | Shaggy |
| 026 | Pascal FPC | 180719T131205Z | AlexRace |
| 011 | Powershell | 180719T094234Z | J. Bergm |
| 010 | Pepe | 180719T084524Z | u-ndefin |
| 2167 | PHP 21 or 67 Bytes | 180517T214953Z | Francisc |
| 021 | JavaScript | 180517T210310Z | Julian K |
| 031 | Python | 180121T190303Z | aaay aaa |
| 011 | Acc!! | 171115T022730Z | qqq |
| 003 | Sesos | 160819T224333Z | NinjaBea |
| 010 | x86 MSDOS | 171112T113530Z | Евгений |
| 002 | Pushy | 171112T111751Z | FlipTack |
| 004 | Recursiva | 170823T131613Z | 0xffcour |
| 002 | Pyth | 170822T172302Z | Stan Str |
| 019 | VBA | 170823T140907Z | Taylor R |
| 008 | K oK | 170823T130809Z | mkst |
| 018 | UNBABTIZED | 160823T150811Z | SnoringF |
| 019 | AutoHotkey | 170718T232628Z | ATaco |
| 335 | Woefully | 170719T090855Z | Teal pel |
| 033 | Common Lisp | 170718T210457Z | Renzo |
| 007 | Braingolf | 170718T160855Z | Mayube |
| 002 | SOGL V0.12 | 170718T163355Z | dzaima |
| 006 | 170718T162236Z | totallyh | |
| 011 | R | 170718T154806Z | Giuseppe |
| 004 | ><> | 160819T224102Z | Emigna |
| 010 | SmileBASIC | 170124T063541Z | 12Me21 |
| 495 | Chicken | 170407T155319Z | Engineer |
| 002 | Insomnia | 160822T031532Z | n̴̖̋h̷͉̃ |
| 069 | Java 7 | 170118T233328Z | peech |
| 024 | C | 170126T041258Z | Albert R |
| 008 | Octave | 160821T032508Z | Stewie G |
| 003 | Japt | 170118T152204Z | ETHprodu |
| 012 | SmileBASIC | 170118T150932Z | snail_ |
| 005 | Cubix | 170117T210632Z | FlipTack |
| 020 | GO | 170117T201311Z | powelles |
| 014 | TIBasic | 170117T202426Z | Julian L |
| 019 | Forth | 170117T194757Z | mbomb007 |
| 004 | SMBF | 160820T060113Z | Steven H |
| 012 | R | 160822T150953Z | Rudier |
| 010 | Haskell | 160819T222715Z | Laikoni |
| 014 | k | 161111T153512Z | Paul Ker |
| 012 | R | 161111T150853Z | brendanj |
| nan | 160819T231644Z | Karl Nap | |
| 030 | Piet | 161016T215426Z | Morgan H |
| 019 | PHP | 161016T210113Z | gabe3886 |
| 015 | Scala | 161016T193806Z | corvus_1 |
| 012 | R | 161014T204248Z | Æzo |
| 006 | Pyth | 161014T195941Z | Dignissi |
| 019 | Vim | 161013T161138Z | udioica |
| 006 | Vim | 161013T155526Z | udioica |
| 032 | PowerShell | 161007T000053Z | Chad Bax |
| 016 | Elixir | 161007T080149Z | adrianmp |
| 030 | Lolo | 161005T070920Z | user4701 |
| 012 | JavaScript ES6 | 160829T020530Z | Eliseo D |
| 017 | QBasic | 161003T094813Z | adrianmp |
| 006 | DC | 160829T011306Z | user1921 |
| 023 | JavaScript | 160914T205252Z | Not that |
| 400 | Woefully | 160910T054453Z | Destruct |
| 032 | R 3.2.2 | 160822T154812Z | JDL |
| 012 | R | 160830T105301Z | Masclins |
| 011 | Powershell v5 | 160819T224846Z | ThePoShW |
| 006 | PHP | 160819T231007Z | YetiCGN |
| 017 | F# Interactive | 160829T053200Z | asibahi |
| 011 | Ruby REPL | 160828T214618Z | anna328p |
| 032 | Visual C++ | 160827T112038Z | code1x1. |
| 022 | Kotlin | 160828T132723Z | Czyzby |
| 006 | Microscript II | 160828T121625Z | SuperJed |
| 002 | Vim | 160827T211406Z | FDinoff |
| 013 | Verbosy | 160827T171105Z | Sweeper |
| 026 | Game Maker Language | 160825T234607Z | Timtech |
| 010 | Vim | 160820T120819Z | Destruct |
| 020 | Perl6 | 160825T030418Z | bb94 |
| 030 | JavaScript ES6 | 160821T205228Z | Hedi |
| 101 | MIXAL | 160824T182510Z | musarith |
| 025 | MSXBASIC | 160824T123843Z | Konamima |
| 1817 | Python 3 | 160820T142545Z | Jonathan |
| 032 | Javascript | 160824T061243Z | chronixl |
| 036 | Lua | 160824T043653Z | PiGuy |
| 001 | Pluso | 160822T070604Z | cdw |
| 055 | Java | 160823T154005Z | user1893 |
| 015 | Whitespace | 160823T151650Z | SnoringF |
| 007 | 3d | 160823T134035Z | joH1 |
| 014 | PHP | 160822T055805Z | Crypto |
| 012 | C# Interactive REPL | 160822T092922Z | Scepheo |
| 006 | Commodore 64 BASIC | 160822T220259Z | Mark |
| 014 | Python 2 | 160819T215502Z | xnor |
| 016 | Mathematica | 160822T200637Z | user4881 |
| 004 | dc | 160822T135837Z | brhfl |
| 050 | Oracle SQL 11.2 | 160822T131326Z | Jeto |
| 001 | Bubblegum | 160822T123243Z | jimmy230 |
| 005 | Labyrinth | 160819T232331Z | Emigna |
| 004 | Senva | 160821T164321Z | ClementN |
| 012 | PHP | 160821T164410Z | Kees |
| 008 | Retina | 160821T130736Z | Martin E |
| 008 | 3var | 160819T230212Z | Emigna |
| 016 | Python 2 | 160821T091525Z | Nateowam |
| 021 | C# Interactive REPL | 160821T021018Z | AquaGene |
| 005 | Fission | 160821T064744Z | Dennis |
| 010 | WolframAlpha | 160821T032901Z | Anastasi |
| 087 | dc | 160820T062301Z | juh |
| 012 | Dyalog APL | 160820T224048Z | ngn |
| 017 | Bash | 160820T211404Z | rici |
| 014 | JavaScript ES6 | 160819T222658Z | Conor O& |
| 014 | Perl 6 | 160820T190035Z | Brad Gil |
| 009 | reticular | 160819T222424Z | Conor O& |
| 020 | Ruby | 160820T175301Z | univalen |
| 055 | ECMAScript 6 | 160820T001552Z | bb216b3a |
| 011 | Javascript | 160820T075846Z | slebetma |
| 024 | Caker | 160820T115921Z | TuxCraft |
| 002 | Pyke | 160820T095049Z | Blue |
| 012 | VBA | 160820T071340Z | Joffan |
| 006 | Befunge98 | 160820T063743Z | tngreene |
| 004 | Brachylog | 160820T055953Z | Fatalize |
| 036 | Lua | 160820T044719Z | tehtmi |
| 005 | Jellyfish | 160820T043919Z | ASCII-on |
| 007 | Brachylog | 160820T041556Z | Leaky Nu |
| 018 | Java 9 jshell | 160820T034249Z | David Co |
| 017 | Ruby | 160820T033704Z | David Co |
| 002 | Actually | 160820T030649Z | user4594 |
| 014 | PHP | 160820T021556Z | Business |
| 008 | Deadfish~ | 160820T012537Z | NinjaBea |
| 015 | Dyalog APL | 160820T011725Z | marinus |
| nan | 160819T223305Z | Karl Nap | |
| 006 | ><> | 160820T002210Z | torcado |
| 008 | Perl | 160819T223727Z | Ton Hosp |
| 021 | JavaScript ES6 | 160819T215816Z | Neil |
| 014 | Snowman | 160819T234016Z | Emigna |
| 003 | Pyth | 160819T232429Z | Maltysen |
| 007 | Befunge 93 | 160819T222009Z | Daniel |
| 005 | MATL | 160819T215800Z | Suever |
| 024 | Brainfuck | 160819T224510Z | Destruct |
| 015 | SQF | 160819T224441Z | Οurous |
| 016 | brainfuck | 160819T223735Z | Dennis |
| 003 | Jolf | 160819T221058Z | Conor O& |
| 004 | Hexagony | 160819T221140Z | Adnan |
| 002 | 05AB1E | 160819T215331Z | Emigna |
| 003 | Jelly | 160819T222543Z | Dennis |
| 005 | MATL | 160819T220952Z | DJMcMayh |
| 002 | Pyth | 160819T215825Z | Dennis |
| 003 | CJam | 160819T215242Z | Dennis |
Alice, 5 bytes
'bto@
'b Push b as its ascii code on the stack
t Pop, subtract 1, push
o@ Pop, print to stdout, exit
Setanta 0.3.3, 64 60 35 bytes
Unfortunately, this challenge is impossible in the current version of Setanta. There is no equivalent to ord, so you have to get the a from the string representation of some object. However, this requires either go_téacs (equivalent of toString) or nasc (equivalent of join), both of which contain an a – "" + obj doesn’t work. However, before Setanta 0.4.0, go_téacs was called go_lit, making it possible to complete the challenge.
The solution gets the a from neamhní (null).
gniomh b(){}scriobh(go_lit(b())[2])
Messenger, 48 bytes
v >v >v
3>* >>*S8 >v
>S >S >>-S8
>^ >^ >-
Messenger is my first (completed) esolang. It works in 2D, and it uses messages for storage, rather than variables or stacks. This makes it tough to code in, since timing and placing have to be managed so that the code doesn't break (or worse, throw an error).
A Python 3.8+ interpreter which works from the command line can be found here. To use it in Try It Online, IDLE, etc., remove the ## WHILE RUNNING ## section of the code.
Explanation
Unused characters in each step have been replaced with a dot.
v
3
Create a message going down, and set its contents to 3.
·>*
>S
>^
Split the message into two identical copies, then put them into the * (multiply) function. This creates a new message carrying a 9.
>v
· >>*
>S
· >^
Split it again, and multiply it by itself again. This creates another message carrying an 81.
>v
S8
>>-
Subtract 8 from 81, giving 73.
>v
S8
>-
Subtract 8 from 73, giving 65.
v
·
-
The message carrying a 65 reaches the bottom edge, where it gets printed as a Unicode codepoint (in this case, a capital A).
Reflection
This is probably close to optimal, since, due to the nature of 2D programs like this, 48 bytes doesn't give you a lot of room. This effect is even further exacerbated by the fact that making numbers in Messenger requires you to smash three or four digits together with arithmetic operations.
Rattle, 9 bytes
=8--s-$c,
This might not be the shortest possible answer in Rattle... Can anyone beat this?
Explanation
=8 set top of stack to 8
-- subtract 2
s save the result (6) to memory
- subtract 1
$ swap the result with the value in memory (swap 5 and 6)
c concatenate these values to get 65
, output ASCII character 65 ('A')
Bash, 15
- 3-8 bytes saved thanks to @DPD-.
echo
{Y..b..8}
There is a CR character immediately preceding the {. This is probably not rendered meaningfully by the browser.
In real terms, this outputs "CRYSPACECRa". The CR (carriage return) moves the cursor back to the beginning of the line, and so the a overwrites the y.
This doesn't render correctly in TIO, so there is an additional pipe to col -b to make the cursor movements absolute.
To enter this at the terminal:
- type
echoSPACE - type CTRL-V CTRL-M
- type
{Y..b..8}
JavaScript (Node.js), 23 bytes
_=>`${[].entries()}`[8]
This is my best attempt at getting capital A.
Google Sheets, 25 bytes
=LEFT(SORT(RITZCODERZ()))
Vyxal 3 g, 1 byte
n
no idea why this happens but n is a builtin for lowercase alphabet and -g flag takes the minimum of the top of the stack which turns out to work on strings ???
Piet + ascii-piet, 14 bytes (10×2=20 codels)
sSsSKNMTFVrFff
(Previous record: 30 codels / ascii-piet bytes)
In ascii-piet, a represents a dark blue cell, and u is a light magenta cell. (x and symbols and digits do not exist.) This program has only one dark color but four different light colors, so I had to rotate the hue so that the resulting ascii-piet representation contains neither a nor u.
The program itself is pretty simple:
4 dup dup * * 1 + outC
(,), 56 Chars or \$56\times \log_{256}(3)\approx\$ 11.09 Bytes
((),()()()()()()()()()()()()())(,,,(())(())(())(())(()))
Python, 32 bytes
print(chr(ord("@")-(-ord("pretend this is SOH"))))
The character in the second ord there is SOH. SOH, which is ASCII 1, is negated and subtracted from @, which is ASCII 64, to make ASCII 65, which is A.
Mathematica, 27 25 24 bytes
Writes 10 in base 24. Half the length is one function name :(
IntegerString[2(8-3),33]
Thanks to Xavier for pointing out that the base doesn't have to be 16 (as in my original hexadecimal solution), and thanks to c-- for saving another byte!
C89, 22 bytes
f(){printf("%c",833);}
Explanation
$ man 3 printf || info '(libc)Other Output Conversions'
"%c ... the int argument is [first] converted to an unsigned char,"
'A' == 65- \$833 \equiv 65\ (\textrm{mod}\ 256)\$
Python 3, 17 Bytes
print(chr(88-23))
$$88-23=65$$
Fig, \$3\log_{256}(96)\approx\$ 2.469 bytes
[cB
Didn't see that there was another Fig answer, but here's a different version.
[cB
cB # "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
[ # First char of the above
Thunno, \$ 5 \log_{256}(96) \approx \$ 4.12 bytes
Z23-C
Explanation
Z23-C # No inputs
Z2 # Push 100
3 # Push 3
- # Subtract to get 97
C # Get the character at that codepoint ('a')
# Implicit output
Thunno, \$ 6 \log_{256}(96) \approx \$ 4.94 bytes
Z3Z2/h
Explanation
Z3Z2/h # No inputs
Z3 # Push 1000
Z2 # Push 100
/ # Divide to get 10
h # Convert to hexadecimal to get 'a'
# Implicit output
Thunno, \$ 7 \log_{256}(96) \approx \$ 5.76 bytes
88 23-C
Explanation
88 23-C # No inputs
88 # Push 88
23 # Push 23
- # Subtract to get 65
C # Get the character at that codepoint ('A')
# Implicit output
K (ngn/k), 26 15 14 bytes
.`c$"c3='cD"-3
-11 bytes from Bubbler
-1 byte from Bubbler (this was primo)
Aheui (esotope), 18 bytes
밣따밯타맣희
This answer "cheats" by choosing a language where the entirety of ASCII (other than newline) is meaningless, but constructing a number is hard (the only constants you can push directly are 0 and 2-9, and -1 on EOF). At least 65 is simpler to construct than 97.
A straightforward program that prints charcode 65 would be 7 chars (21 bytes): 밣발다발따맣희, or in pseudo-assembly:
push 8; push 5; add; push 5; mul // pushes 65
putchar; halt
But the program at the top uses a specific behavior of arithmetic operators that, if there are not enough operands, the next direction is reversed. So 밣따 (push 8; mul) at start runs like this:
push 8 // [8]
mul // fails; go back to `push 8`
push 8 // [8, 8]
mul // [64], proceeds to the next command on its right
Then the remaining instructions are:
밯 getchar // push -1 instead because EOF
타 sub // adds 1 to 64 to get 65
맣희 putchar; halt
Python 2, 17 bytes
print`help`[23-2]
Explanation
help in python gives help for things. When just help is typed, a message saying Type help() for interactive help, or help(object) for help about object. is printed, which has a as its 22nd letter, or 21 when zero-indexed.
J, 14 10 8 6 bytes
hfd-!3
-2 thanks to south, with another 4 on a variation of south's idea
-2 thanks to Bubbler and south, taking that idea one step further
We take the hex representation of -6.
Kustom, 33 bytes
$tc(reg,tc(type,أ),".....$","")$
explained:
$tc(reg, regex replace
tc(type,أ), text type of some Arabic character (="ARABIC")
".....$", replace 5 characters at the end...
"" ... with the empty string
)$
HTML5, 99 48 47 bytes
<p id=e><script>e.innerHTML=` ${!2}`[2]</script
Apparently you don't need the > after </script to parse correctly
(old versions)
<p id=e><script>e.innerHTML=` ${!2}`[2]</script>
<p id=e><script>this[`doc${[!!2].join``[2]}ment`].getElementById`e`.innerHTML=` ${!2}`[2]</script>
Try it below:
<p id=e><script>e.innerHTML=` ${!2}`[2]</script
Deobfuscated (new version):
<!DOCTYPE html>
<html>
<head></head>
<body></body>
<p id="paragraphID"></p>
<script>
// in JavaScript, when paired with HTML, any element with an id implicitly has the element with the id stored as a global variable, so you don't need to call document.getElementById or document.querySelector
paragraphID.innerHTML = ' false'[2]; // JS is 0 indexed, so ' false'[2] is 'a' (there's a space before 'false')
</script>
<html>
Deobfuscated (old version):
<!DOCTYPE html>
<html>
<head></head>
<body></body>
<p id="paragraphID"></p>
<script>
document.getElementById("paragraphID").innerHTML = ' false'[2]; // JS is 0 indexed, so ' false'[2] is 'a' (there's a space before 'false')
</script>
<html>
[!!2].join``[2]
is [true].join("") is true.toString() is "true", and the 2nd index of "true" is u
` ${!2}`[2]
This is " false" index 2, which with the space at the beginning is a (inspired by slebetman)
Straw, 6 bytes
Bæ}Æ>
Take the codepoint of B (Bæ), get the tail of the string (unary decrement) (}), take the character associated with the codepoint (Æ), and print it (>)
Flobnar, 8 bytes
!g<
@:*,
Uses the initial value 0 of : (the current argument), and the fact that 33 ('!') * 33 % 256 == 65 == 'A'. Other candidates include:
95 ('_') * 95 % 256 == 65 == 'A'
49 ('1') * 49 % 256 == 97 == 'a'
79 ('O') * 79 % 256 == 97 == 'a'
but all of these are either not useful or simply banned. Particularly it is too bad that 7 is also banned.
@ Start here, facing west
, Evaluate and print mod 256 as char (using -w flag):
* Multiply its north and south (both of which point to <)
< Evaluate to left
g Take north as x and south as y, and get the code value at (x,y)
: Both x and y evaluate to 0
(0,0) is '!' == 33, so (33 * 33 = 1089) % 256 = 65 = 'A' is printed
k (ngn/k), 26 bytes
.""/("`";$8-8;":";`k@$@())
@() evaluates to the type of (), or `A. using `k@$ converts it to a string and then pretty prints it, giving us "A". we put this in an array, along with "`", "0", and ":", which once we join with ""/ gives us `0:"A". we evaluate this as k code with . which prints A to stdout.
try it on the ngn/k repl.
StupidStackLanguage, 9 bytes
rvvddqmif
Explanation
r # push length of stack (0)
vvdd # push 8 to stack
qm # square
i # increment
f # print as ASCII
KonamiCode, 17 bytes
v(^^^^^^>^^^^^)<<
PICO-8, 16 bytes
?chr(ord("c")-2)
Moves back from C to get to A.
Lean Mean Bean Machine, 11 9 bytes
O
"
b
)
!
O Spawn a marble,
"b set it to b,
) decrement it,
! print it.
I don't recall when this was changed, but LMBM now automatically destroys a marble if it falls out of bounds, so the ; is no longer needed
Excel, 15 bytes
=MID(2=3,2,3-2)
Show the second character in FALSE
VBA (immediate window), 14 12 bytes
Lower case (12): ?chr(33*3-2)
Upper case (14): ?chr(8*8--3-2) or ?chr(23*3-2-2)
Knight, 10 9 bytes
O G F T T
# print...
OUTPUT(
# extract a substring
# Specifically, the "a" from "false"
GET(
FALSE # coerces to "false"
TRUE # 1
TRUE # 1
)
)
- 1 byte to a massive dum moment, thanks MarcMush
Pxem, 9 bytes (filename) + 0 bytes (content) = 9 bytes.
- Filename:
CBB.-.-.o - Content: none.
The code is equivalent to:
push 'B'
push 'B'
push 'C'
push(abs(pop()-pop())) if size>=2 else nop
push(abs(pop()-pop())) if size>=2 else nop
printf("%c",pop()) if size>=1 else nop
TeX, 7 bytes
^^!\bye
An extra 12 bytes if you wanted to supress the page number:
^^!\def\folio{}\bye
Befunge-93, 7 bytes
"}<"-,@
Explanation
"}<" Push 125 and 60 using ASCII mode
- Subraction
, Print as ASCII
@ End the program (so you don't get AAAAAA... :) )
BRASCA, 1 byte
Uppercase: D
Lowercase: h
Explanation
There's isnt really that much to explain. D pushes 65 to the stack, h pushes 97 to the stack, and implicit output does the rest.
Python 3, 24 bytes
print(chr(88-23),end='')
Prints an uppercase A without a newline.
Python 2, 16 bytes (with newline)
print chr(88-23)
Bash, 14 13 bytes
tr PQ @-B<<<Q
Output:
A
Brainfuck, 192 19 bytes
----[>---<----]>--.
Thanks to @NinjaBearMonkey for helping me save hella bytes
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.
I'm not good at Brainfuck so I'm sure theres a shorter solution, but it works by decrementing below 0, rolling the byte over, and keep going until it gets down to 'A', then it prints.
Groovy, 9 bytes
f={--'B'}
Makes use of the decrement operator overloading on Strings, per CharSequence.previous().
Previous solution
I missed the fact that a return value was an acceptable alternative to printing the result.
Groovy, 12 bytes
print(--'B')
Whispers v2, 190* 108 bytes
> e
> 8
>> 2²
> e
> e
> e
> e
>> ≻3
> e
> e
> e
> e
> e
> e
> e
> e
> e
> e
> e
> e
> e
>> '8
>> Error 22
Outputs A to STDERR, which is an accepted method of output
*82 bytes saved by golfing formula from \$65 = (3 - (-2)) - (-2 \times 3) \times (8 - (-2))\$ to \$65 = 8^2+1\$
How it works
Whispers is different to most languages, in that numbers (0123456789) don't always represent their numerical values. A Whispers program is a series of lines, each of which matches (at least) one of a series of regexes. All the regexes require a line to begin with either > or >> (note the space).
Lines that begin with > are nilad lines, and return a constant value each time. on these lines, digits do represent their respective numerical values. For example, line 2 (> 8) returns the integer \$8\$.
However, lines beginning with >> treat numbers as line references, rather than numerical values. This means that >> 2² doesn't actually return \$2^2 = 4\$. Rather, it retrieves the value on line 2 and returns its square. Execution works by starting on the last line, and getting values passed along through other lines, similar to a game of Chinese Whispers (hence the name).
Now, as we can't use any of 0145679, we have to construct either \$65\$ or \$97\$ using only \$2\$, \$3\$ and \$8\$. Furthermore, we can't refer to any lines aside from 2, 3, 8, 22, 23, etc. which is why we have so many lines that are just > e. These are all unexecuted, and just serve to pad the important lines to line numbers that we can use.
We use the formula \$65 = 8^2 + 1\$ in order to build \$65\$ (the char code of A). Luckily, Whispers has an increment command (≻), so we don't have to deal with addition or calculating the number \$1\$. So, we start execution on the last line:
>> Error 22
This calls line 22, outputs its value to STDERR, then exits. Line 22, directly above, is
>> '8
' is the to character command, equivalent to Python's chr builtin, so here, we take the value on line 8 and convert it to a Unicode character. Now, we can see lines 2, 3 and 8, in order:
> 8
>> 2²
>> ≻3
Kind of counter intuitively, these lines are executed in reverse order: first line 8 increments the value on line 3, then line 3 squares the value on line 2 i.e. \$8\$. Ultimately, line 8 returns \$8^2 + 1 = 65\$ which is then cast to character and outputted to STDERR.
x86-16 machine code, IBM PC DOS, 6 bytes
Binary (CP437):
░@@═)├
Unassembled listing:
B0 40 MOV AL, '@' ; One below ASCII 'A'
40 INC AX ; increment char
CD 29 INT 29H ; write AL to console
C3 RET ; return to DOS
Google Sheets/Excel (15 bytes)
Assuming your localization is in English:
=MID(2=3,2,2/2)
Note: this will not work on LibreOffice because it will change FALSE to 0 instead of "FALSE".
Brainetry, 141 bytes
a b
a b c d
a b c d e f g h
a b c d
a b c d e f g h
a b c
a b c d e f g h i
a b
a b
a b c d
a b c
a b c d
a b c d e f g h i
a b
a b c d e f g
The code above is the golfed version of this program:
Hey, look,
I'm not even going
to try, ok? I will jvst write regvl@rly
@nd then svbstitvte the
letters yov do not w@nt me to vse.
Is this ok@y?
I re@lly hope yov do not mind. Other th@n
th@t, this
is @
f@irly st@nd@rd ch@llenge, I
jvst went online
@nd googled short w@ys
of gener@ting the const@nt 65 in br@infvck. Of covrse
I w@s
sent str@ight to the Esol@ngs web p@ge.
International Phonetic Esoteric Language, 8 bytes
My original answer used the old instruction set and interpreter, which have since been completely rewritten. Still abusing Unicode, and somehow the same length heh.
"C"ʁ2zχo
Explanation:
"C"ʁ (push "C", convert str to num 67) ( -- 67)
2 (push 2) ( -- 67 2)
z (subtract) ( -- 65)
χ (convert num to str) ( -- "A")
o (print) ( -- )
International Phonetic Esoteric Language, 8 bytes (WIP language) (OLD)
2<C>ʀdχo
The wonders of abusing Unicode as your instruction set.
No TIO interpreter yet, but is runnable by cloning the repository above, and calling python main.py "code here".
2<C>ʀdχo
2 ; push 2
<C> ; push "C"
ʀ ; pop, push ord("C")
d ; pop, push 67 - 2
χ ; pop, push chr(65)
o ; pop, print string
Python - 20 bytes
print(chr(-~(8<<3)))
IPython 7.11.1 - 19 bytes
print(__doc__[3^3])
Ruby, 16 bytes
$><<[*??..?B][2]
Get's the third element in the range from '?' to 'B', which is 'A'!
Explanation
$><<[*??..?B][2]
[* ] create an array containing the elements from
.. the inclusive range from
?? literal '?' character to
?B literal 'B' character
this array is now ['?', '@', 'A', 'B']
[2] get the 3rd element of this array ('A')
<< append/write that to
$> standard output
Lenguage, 62,544,587,333,324 bytes
Unary, 134,032,404,790,876 bytes
I couldn't resist ;)
Programs consists of 62544587333324 and 134032404790876 times the character B (or any allowed character you choose to). (Actually pretty short for Lenguage/Unary..)
Port of @Dennis♦' Brainfuck answer.
Byte-counts generated by this program I wrote in 05AB1E.
Wenyan, 39 33 bytes (WIP language)
加陰以『』夫其之二書之
Update: Wenyan now supports 『』 in place of 「「」」 for quoting strings. (starting from v0.1.2)
Literally console.log((false+"")[2-1]) but not using any of +, a and 1
Explanation
書之 // console.log( )
夫其之 // ( )[ -1]
陰 // false
加 以 // +
『』 // ""
二 // 2
Note: Indexing in Wenyan is 1-based.
Pip, 4 bytes
/O@z
Explanation
z Lowercase alphabet
@ First character
O Output without newline
/ Invert
That last (first?) instruction requires some more explanation:
By default, Pip prints the last expression in the program with a trailing newline. (This is why we couldn't do @z for 2 bytes, since the challenge states that newlines should be avoided if at all possible.) That's a problem because O@z, in addition to outputting a without a newline, is also an expression that evaluates to a. So O@z by itself would print aa plus a newline.
There are two ways to get rid of the extra output: First, we could output inside an if statement (5 bytes: IzO@z or other similar programs). Second, we could make the final expression in the program evaluate to nil. Nil produces no output when printed, not even the trailing newline. The usual way to suppress auto-printing is to end the program with u, a variable preset to nil. Unfortunately, u is banned. We could use the nil expression (), which would put us back at 5 bytes: O@z().
Enter the unary division operator /, which inverts its operand. In this case, if we invert O@z, the operand is the string a. Non-numeric strings evaluate to 0 in numeric contexts, which means we're dividing by 0. This gives nil, which suppresses the newline exactly as desired.
05AB1E, 6 4 bytes
2<.b
Explanation
2< # push 2 and decrement (now 1 is on the stack)
.b # push the [top value]th letter of the alphabet (the 1st letter)
# implicit output
BBC Basic IV, 19 15 bytes
23PRINTCHR$(88-23)
Older Answer: 19 bytes
23PRINTCHR$(8^2-(2-3))
The statement...
P.TOP-PAGE
...shows the size of the program, which is 19 bytes.
Keg, 1 byte (SBCS)
Ȧ
Ah, yes, restricted-source challenges. The exact thing the push'n'print feature was added to Keg for. Very simple this program: just print the letter a to output.
No, it's not cheating because it's a feature designed for all restricted source challenges. And also, Ȧ doesn't have any forbidden code points.
No TIO yet because it needs a quick update but works on the Github interpreter (just make sure to use Keg.py)
Brain-Flak, 28 bytes
(((((()()()()){}){}){}){}())
code:
(((((()()()()){}){}){}){}()) push 65
implicitly print stack
Brian & Chuck, 7 bytes
B?
!<-.
code:
Brian:
B constant B
? switch to Chuck
Chuck:
< go to B
- decrement it
. and print it
Runic Enchantments, 6 bytes
'Bl-k@
"length of stack" acts as a placeholder for the value 1. 'Lb-k@ and 'C2-k@ both also work and are the same number of bytes.
Keg, 3 2 bytes
B;
This pushes the ASCII character B onto the stack, and then decrements the value by 1. The value will automatically be printed.
Number Factory, 4 bytes
%>>%
You can test it with my interpreter.
There are several coincidences that together make this as short as it is:
- The factory contains a room specifically for the output of letters.
- The encoding scheme used by that room is 1-indexed.
- The initial room contains 1.
- The initial room and the alphabetic output room are only 2 squares apart.
AppleScript, 16
string id(88-23)
Java 8, 9 bytes
()->'C'-2
-31 (!) bytes thanks to ASCII-only!
Try it online!
How?
I'm not sure. Best guess is the result of the subtraction is implicitly cast to char because of the return type of the function.
!@#$%^&*()_+, 3 bytes
`^@
Try it online! Outputs lowercase.
Shortest for A seems to be 5 bytes: >^^^@ or B_^_@.
Explanation
`^@
` push the character "`"
^ increment (to `a`)
@ output as character
MathGolf, 3 2 bytes
-1 byte thanks to maxb
╩Z
Fetches the 90th word in the dictionary, which is a uppercase 'A'.
Scratch, 38 bytes
when gf clicked
think(letter(2)of<[]<[
think is used instead of say because say has an a.
Ahead, 6 bytes
'C2-o@
'C push 67 (C in unicode)
2 push 2
- subtract
o print char
@ end
MBASIC, 19 bytes
2 PRINT CHR$(88-23)
I swear I came up with this solution before finding those other (similar) BASIC answers. Apparently great minds do think alike. :-)
C# (.NET Core), 44 bytes
Console.Write(Convert.ToString(33-23, 8*2));
Converts the decimal value 10 to its hexadecimal equivalent (a).
Kotlin, 7 bytes
{'C'-2}
This is a lambda that returns the Char A. Char overloads the minus operator. Since C is 2 characters after A in Unicode, 'C'-2 produces A.
Aheui (esotope), 21 bytes
밡밤다발따맣홄
Explanation:
밡: push 9, move cursor right by 1(→).
밤: push 4, →
다: add, →
발: push 5, →
따: mul, →
맣: print as character, →
홄: end.
Pascal (FPC), 26 bytes
begin write(pred('B'))end.
At first, I wanted to use standard 88-23 approach, but luckily, there is the pred() which returns previous element of an ordinal type (integers, characters and enumerated types).
Powershell, 11 bytes
" $(!2)"[2]
Every non-0 integer evaluates to True when casted to [bool].
!2 implicitly converts 2 to [bool] and negates it, so it becomes False.
$() blocks inside a string allow expressions to be evaluated before being converted to string.
When accessing a string with an index the string is treated as a char-array.
Since we're not allowed to use 1 i had to use a space to shift the a in False one to the right.
Another option would be a negative index: "$(!2)"[-4].
PHP 21 or 67 Bytes
Kinda cheating but implode on $_SERVER just leaves a on the 8th position
<?=join($_SERVER)[8];
Else
Creating an array of letter strating at chr(88) and end it at chr(33) leaves an A at position 23
<?php $u=[];for($i=88;$i>33;$i--){$u[]=chr($i);}echo join($u)[23];
JavaScript, 21
Capital A because there seems to be no other solution to find a capital A
_=>`${[].keys()}`[8]
`${[].keys}` => "[object Array Iterator]" 8th index is A
_=>`${keys}`[38]
Also works in browser for similar reasons.
Edited to add function
Python, 31 bytes
print(chr(-~(2**(8-2))),end='')
Explanation: 8-2 is 6, and 2**6 (2 to the power of 6) is 64. chr(65) is A, so I need to add 1 without using + (or 1). I then used -~ which adds 1, creating chr(65) which is A.
Acc!!, 16 11 bytes
Write 32*2-(2-3)
Write 88-23
Write tells it to output ASCII, 32*2=64, -(-1) gives 65
I realized 88-23 also gives 65
Sesos, 3 bytes
The code contains two unprintable characters, so here is a hexdump:
0000000: a85a0d .Z.
Try it online! (Note that this uses the assembly code, which TIO converts to the binary above as an intermediate step. The binary is shown as a debug message.)
It is generated from this assembly program:
add 65
put
x86 MS-DOS, 10 bytes
b4 02 mov ah,0x2
b2 40 mov dl,0x40
fe c2 inc dl
cd 21 int 0x21
cd 20 int 0x20
Try yourself
echo "B402B240FEC2CD21CD20" | xxd -r -p > TEST.COM
Recursiva, 4 bytes
Y(L'
Explanation:
Y(L'
Y - From, Take n-th element 'A'
( - Upper-case alphabet 'ABC...Z'
L - Length of i.e. 0
' - empty string
Pyth, 3 2 bytes
-1 from Dave reminding me to actually read the docs
hG
Explanation:
hG The first entry in G (the alphabet)
VBA, 19 Bytes
Anonymous VBE immediate window function that takes no input and outputs A to the VBE immediate window
?Chr(-(-32-32-3)-2)
K (oK), 8 bytes
Solution:
`c$88-23
Explanation:
Interpretted right-to-left:
88-23 / 88 minus 23 is 65
`c$ / cast to character ("A")
UNBABTIZED, 18 bytes
!0,88.(°0,23.:°0
!0,88. put 88 in cell 0
(°0.23. subtract 23 from cell 0
:°0 print cell 0 as character
AutoHotkey, 19 bytes
Send % Chr(8-2 8-3)
This types a single character, A. It does so through AHK's surprising yet convenient implicit concatenation.
Send tries to write a string.
%tells it to use the value of an expression (Rather than just plaintext)
Chr() converts a number to a character. 8-2 8-3 evaluates to 6 5 which evaluates to 65, the ASCII code for A.
Woefully, 335 bytes
|||||||| |
||||||| |
|||||| |
||||| |
|||| |
||| |
|| |
| | --push5; A[5], B[]
| |
| |
| |
| |
| | -- dupeA2B; A[5], B[5]
|| |
||| |
|||| |
||||| |
|||||| |
||||||| | -- swap dec/ascii (set to ascii)
|||||| |
||||| |
|||| |
||| |
|| | --push3; A[5,3], B[5]
|| |
|| | --popA2B; A[5], B[5, 3]
||| |
||| |
||| |
||| |
||| | --multiply; A[15], B[5]
|||| |
|||| |
||||| |
|||| |
||| |
|| |
| | --push2; A[15, 2], B[5]
| |
| | --popA2B; A[15], B[5, 2]
|| |
|| |
|| |
|| | --sub; A[13], b[5]
| |
| |
| |
| |
| | --multiply; a[65], b[]
|| |
||| |
|||| |
||||| |
|||||| | --print; OUTPUT; "A"
|||||| | --no op ends program
I've added the explanation of each step at the end of the step.
Common Lisp, 33 bytes
(elt(string(type-of 3/2))(- 3 2))
type-of 3/2 returns the symbol RATIO, string transforms it into a string, and finally elt gets the character at index 1 (i.e. A).
Braingolf, 7 bytes
"C"2-@;
Screw you @totallyhuman :(
Explanation
It subtracts 2 from C and prints.
Braingolf, 12 bytes
Keeping this one because IMO it's the better answer, and took way more effort to do.
/..*3*<2*-@;
Man, this was hard.
Explanation
/..*3*<2*-@;
/ Niladic division, push 5 [5]
.. Duplicate twice [5,5,5]
* Multiply last 2 items [5,25]
3 Push 3 [5,25,3]
* Multiply by 3 [5,75]
< Left-shift stack [75,5]
2 Push 2 [75,5,2]
* Multiply last 2 items [75,10]
- Subtract last 2 items [65]
@ Print as character, 65 is the ASCII value of A
; Suppress implicit output
Braingolf, 9 bytes
And here's a shorter one that still uses the "calculate 65" method
/82*3-*@;
Explanation
Uses niladic division for 5, calculates 13 from (8 * 2) - 3, then multiplies 5 and 13 to make 65
Braingolf, 11 bytes
And finally here's one that prints a lowercase a.
*v/2*c/3-@;
Explanation
*v/2*c/3-@;
* Niladic multiply, push 1000 [1000]
v Switch to stack2 []
/ Niladic division, push 5 [5]
2* Double [10]
c Collapse stack into stack1 [1000,10]
/ Divide last 2 items [100]
3- Subtract 3 [97]
@; Print as ASCII and suppress implicit output
97 is the ASCII value of a
SOGL V0.12, 2 bytes
Κ‘
Try it Here!
A simple compressed string of "A". Really it should be more than a byte (3 bits on saying that it's a character + ~6.5 bits = 8.5 bits = 1 1⁄16 bytes), but I got lucky.
,,,, 6 bytes
'Co2-c
Explanation
'Co2-c
'C push "C" ["C"]
o convert to ASCII ordinal [67]
2- subtract 2 [65]
c convert to ASCII character ["A"]
implicit output []
><>, 7 4 bytes
Saved 3 bytes thanks to Teal pelican
"-o.
Explanation
"-o." # pushes the string "-o."
- # subtracts the charcode of o from the charcode of . (dot), 111-46=65
o # prints as character
. # tries to pop 2 coordinates to jump to, but as nothing is left on the stack
# the program ends in an error
SmileBASIC, 10 bytes
?KEY(2)[2]
KEY accesses the function buttons used in the editor.
They can be set to any string, but by default they are 1:FILES 2:LOAD" 3:SAVE" 4:LIST ERR\r 5:RUN
Chicken, 495 bytes
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken
You have to copy and paste the code but you can try it online.
Insomnia, 2 bytes
Since any character is allowed, I used an unprintable character in the code (\u001a). Hex dump included below:
0000000: 641a d.
StackExchange doesn't display control characters in the post, so click on edit to see the raw source code below and copy it to test on the online interpreter:
d
Java 7, 73 69 bytes
Golfed:
void m(){System.err.println(new Object().toString().split("")[3-2]);}
Ungolfed:
void m()
{
System.err.println(new Object().toString().split("")[3 - 2]);
}
Outputs a to the standard error.
C, 20 24
Surprisingly, you can cast negative integers to characters in C and you will get ASCII characters. I ran a loop up to -10,000 and found a few values that produce the character "A". One of which was -8383 which uses no invalid characters. Another being -2239 which breaks the rule of using '9', however you can use a bit operation of ~2238 which becomes -2239.
The generation function for negative integers producing 'A', at least in C-GCC4.9.2, is 65-256*i ... The first few are -191, -447, -703, -959 (Note: this is the same as 'A'-(256*n))
f(){printf("%c",-8383);}
f(){printf("%c",~2238);}
f(){printf("%c",-'¿');} //¿ (2 bytes) is x00BF in unicode (or 191 in base10), -191 = A
Bonus: printf("%c",-'₿'); //negative bitcoin produces A because bitcoin symbol is x20BF which is base_10 is 8383, -8383 cast to char is 'A', but the bitcoin symbol is 3 bytes putting my score to 25 so this is my popularity contest answer, not my codegolf answer
Edit: I can't use putchar since it contains a "U" and an "A". I've updated the answer above to use printf and thus increased my code by 4 bytes from a score of 20 to 24
Octave, 13 11 8 bytes
Didn't expect to golf this answer down, but wohoo, a bug(?) in Octave made it possible to save two bytes! :) Converting this to a "full program", instead of a function saves an additional three bytes, leaving us with 8 bytes:
['',833]
['',833] concatenates the empty string with the number 883. The ASCII code for A is 65, so 883 might seem a bit odd. I think this must be a bug, but what Octave does when concatenating an empty string and a number is that it takes the number modulus 256. mod(883, 256) == 65 which just so happens to be the ASCII code for A.
Octave does not do this when using the "proper" method, char(883), in which case we will get:
warning: range error for conversion to character value
Japt, 3 bytes
Any of these 3-byte programs work:
;Bg
;Cg
;Hd
How it works
; Set B to the uppercase alphabet,
C to the lowercase alphabet,
and H to 65, among other things.
Bg Take the first char of B.
Hd Take the character with charcode H.
Implicitly output.
Any of these 4-byte programs work as well:
;EgG
;EgI
;FgG
;FgH
°I d
IÄ d
SmileBASIC, 12 bytes
Self-explanatory.
?CHR$(88-23)
Cubix, 5 bytes
o'@)^
Try in the online interpreter!
Cubix is a language where (as the name implies) everything is executed on the faces of a cube. This code maps to the following cube:
o ' @ ) ^ .
The basic idea of this answer is to get a nearby character and increment it to what we need. In Cubix, @ is the exit command needed to terminate the program, but also conveniently right under 'A' in the ASCII table. This means we can use the character once to mean two different things, saving bytes - here's the order in which the code is run:
'@pushes the character code 64 to the stack.)increments the top of stack, yielding the desired character.^sends the instruction pointer north, wrapping around to...ooutputs the top of stack,A.@terminates the program.
TI-Basic, 14 Bytes
:ClrHome
:Disp "Ans
:Output(1,2,"
Note the two trialing spaces at the end of line 3.
- TI-Basic has its own character encoding where many commands are 1 or 2-byte tokens. For example,
ClrHomeis a single byte.Ansis a single byte, so it does not violate the challenge rules.
Cheat version, 3 bytes
:"a
In this code, use the a from the statistic menu: VARS > 5 > Right Arrow > Right Arrow > 2.
Forth, 19 bytes
Creates the number 65 (23*3-2-2), then outputs it as the character A.
23 3 * 2 - 2 - emit
SMBF, 4 bytes
<-.B
Explanation:
<- Wrap pointer around to the "B" and decrement it, giving "A"
. Print
B Data storage
R, 27 12 bytes
EDIT : New version, from an excellent idea from @Jarko Dubbeldam
LETTERS[T*T]
Quite a funny challenge !
Basically, this takes the 26th element of the reversed vector containing the uppercase letters (LETTERS, which is a R's built-in vector)
Previous versions (same number of bytes) :
L=LETTERS;rev(L)[length(L)]
rev((L=LETTERS))[length(L)]
Haskell, 10 bytes
As a function (or rather a statement as no input is required)
f=pred 'B'
does the trick. Try it on Ideone.
A full program is impossible as this would need to contain a main.
k, 14 bytes
*|$`byte$38-28
This returns "a"
R, 12 bytes
letters[2/2] #12 bytes; rules followed!
I tried other ways of doing this, but they broke the rules :(
tail(rev(letters),n=2/2) #24 bytes; uses 'a'
head(letters,n=2/2) #19 bytes; uses 'a'
C++14, 30 bytes
As unnamed lambda (allowed in Python):
[](decltype('B')*c){*c='C'-2;} //'c'-2 for lowercase
//Usage:
#include <iostream>
main(){
char c;
[](decltype('B')*c){*c='C'-2;}(&c);
std::cout << c << std::endl;
}
33 bytes
Function that assigns to its parameter:
int f(decltype('B')*c){*c='C'-2;}
//Usage:
#include <iostream>
main(){
char c;
f(&c);
std::cout << c << std::endl;
}
Pretty hard to do it otherwise since no #include, return or auto because of U. Modifying parameters for return values seems ok Meta
Piet, 30 codels
I'm sure that this can be improved, but I'm a bit of a Piet newbie.
Side note: I have titled it Icy Toll Gate to a Nether Portal. It's artistic, but not abstract, so it kind of follows the main design principle!
PHP, 19 Bytes
<?=chr(ord('C')-2);
Get the ASCII value for C and take 2 off it. Doesn't need any special encoding and will work in PHP 4, 5 and 7
If you turn errors off you can reduce it to 17:
<?=chr(ord(C)-2);
Scala, 15 bytes
((2>3)+"")(3-2)
Explanation:
(
(2>3) //false
+"" //toString
)(3-2) //zero-indexed 1st char is 'a'
R, 12 bytes
LETTERS[2/2]
Pretty self-explanatory: LETTERS is all the upper case letters, and 2/2 evaluates to 1, so we get the the first element.
Vim, 19 bytes (not competing)
:redi@"|Ni!<CR>pJd3w~D
Do you demand a shrubbery?
Vim, 6 bytes
grNg??
Challenge doesn't block N, and Vim has a ROT-13 feature. FDinoff's answer is probably cooler, but this is ASCII and works everywhere.
PowerShell, 89 59 32 Bytes:
[Convert]::ToString((8-3)*2,8*2)
$d=2-2;[char][byte]"".insert($d,(3*3)-(2*2)).insert($d,2*3)
$b=[string]::Concat(2*3);$c=[string]::Concat((3*3)-(2*2));[char][byte]$b.insert(2*2-3,$c)
edit: use of It is possible...a I see no way around this(not a golf language)
Elixir, 16 bytes
IO.write [88-23]
Try it online on ElixirPlayground !
Elixir outputs the character(s) with the ASCII code specified in the list.
Using IO.puts would make it 1 byte shorter, but u is not allowed.
As expected, the interactive mode removes the need of explicitly calling IO functions for on-screen output.
Elixir Interactive, 7 bytes
[88-23]
Lolo, 30 bytes
loloLo lOLo lo LOlo LO lOlolol
The only way to make characters in Lolo is to get it's number representation and convert it into a character.
Here, I get 65 which gives me A.
JavaScript ES6 ES5, 23 17 12
12 bytes
`${!3}`[3-2]
17 bytes: (typeof!3)[2- -3]
23 bytes: _=()=>(typeof!3)[2- -3]
Edit 05/10/2016:
Took advantage of templating strings, as well as boolean coercion and string/array indexing... Also realized my previous code used +, I could always salvage 2+3 as 2- -3 at a cost of 2 bytes for each previous example... (Updated code and scores for previous submissions)
Edit 30/08/2016:
I took a different approach, exploiting the fat arrow functions as well as the typeof return type, which is a string. So converting a number to a boolean was easier then, had to encase it in parentheses before pulling the 5th element of the resulting string...
Seems that there was no mention of my answer requiring to be in the form of a function, so I've just stripped the fat arrow function declaration.
QBasic, 17 bytes
PRINT CHR$(88-23)
Exploits the fact that the function which converts an integer to char is named CHR.
JavaScript, Node console, 23
Shortest JavaScript I can do for a capital A.
This only works in the Node REPL console.
Object.keys(this)[2][3]
This only works in Firefox REPL (27)
Object.keys(this)[8*3][2*3]
Woefully, 400 bytes
| || |
|| |
||| |
|||| |
||||| |
|||||| |
||||||| |
|||||| |
||||| |
|||| |
||| |
|| |
| |
| |
| |
| |
| |
| |
|| |
|| |
|| |
|| |
|| |
|| |
||| |
||| |
||| |
||| |
||| |
|||| |
|||| |
|||| |
|||| |
|||| |
||| |
|| |
| |
|| |
|| |
|| |
||| |
|| |
| |
| |
| |
| |
|| |
|| |
|| |
||| |
||| |
||| |
||| |
|||| |
|||| |
||||| |
|||| |
||| |
|| |
| |
|| |
||| |
|| |
||| |
|||| |
||||| |
|||||| |
||||||| |
Can probably be golfed more
R 3.2.2, 34 32 bytes
This is a tricky challenge in R, since the only function that will print without quotes and junk is cat, which contains an "a". We have to get it by indirect means. In a fresh R installation with no extra packages, the base package (in which cat resides) is the eighth in the search list (luckily 8 isn't prohibited!)
cat is the 297th thing in the base package, but 9 and 7 are prohibited. I think 322-23-2 is the most efficient way to calculate 297, but I may be wrong!
(Edit: I was wrong. Thanks to Albert Masclans for pointing out that 33*3*3 is more efficient. I also added the R version number since later versions of R will probably introduce more things into the base package.)
"a" is held in the first element of letters (alternatively, use LETTERS if you want "A") but since 1 is prohibited, we use 3-2 to get it.
get(ls(8)[33*3*3])(letters[3-2])
R, 12 bytes
I was losing it until I realized I can use 2 and 3.
LETTERS[3-2]
Powershell v5, 13 12 11 bytes
"$(!2)"[$?]
Thanks to krontogiannis for saving me a byte.
Old 12 byte solution.
"$(!$?)"[$?]
Explanation:
"$(!$?)"[$?]
$? #returns the status of the last command, in this case, the call to this PS file
! #false operator
$( ) #runs the code in between () even while its in between ""
" " #converts to string
[$?] #returns index 1 (true) of the preceding string (1 is forbidden)
I don't have any earlier versions easily available to test on right now, but this should work back to v2 at least.
PHP, 9 6 bytes
<?=O^_^Q;
For 9 bytes: Inspired by @Ton Hospel's answer. Plus, it has the added benefit of looking a bit like a Kaomoji. :-)
The 6 bytes improved version:
<?=~¾;
wherein ¾ has the hex code of 0xBE (it is important to save the file in Latin-1 encoding, not UTF-8!).
F# Interactive, 17 bytes
string(3<2).[3-2]
This produces the following in the Output:
val it : char = 'a'
to print it to STDOUT, well, it becomes larger: 29 chars.
printf"%c"<|string(3<2).[3-2]
Ruby REPL, 11 bytes
(88-23).chr
88 - 23 = 65. 65 is the decimal representation of ASCII A. The chr function changes the decimal representation to the character. The REPL displays the result.
Visual C++, 32 bytes
std::clog<<decltype('C')('C'-2);
or
std::clog<<decltype('C')(260>>2);
on the basis of @Karl Napf
dont know why it gets downvoted it clearly compiles on VisualC++2015 and outputs A on my Machine
Kotlin, 22 bytes
{print("${3<2}"[3-2])}
This is a lambda that prints a to the console when invoked. Converts false (3<2) to string via string template and returns the 1-indexed character.
Microscript II, 6 bytes
2s'C-K
Basically subtracts 2 from the char code of C, then converts back to a character before printing implicitly.
In the original Microscript, it becomes this 7-byte program:
2s'C-Ph
Vim, 2 Keystrokes
vim -u NONE then run the following (-u NONE turns off customization)
i<up>
When vim is run in compatible mode the arrow keys are don't get interpreted properly. <up> gets interpreted <esc>OA which leave the following in insert mode. Which would leave (with a couple of trailing newlines)
A
i starts insert mode.
<up> exits insert mode, opens a line above and enters A into the buffer
Example of people encountering this in the wild. https://stackoverflow.com/questions/6987317/while-moving-the-cursor-across-a-vim-process-open-in-a-tmux-session-every-now-a/6988748#6988748
Verbosy, 13 bytes
~` /3 ^3 \3 o
Verbosy is actually a language I wrote (see the link). Hopefully that's allowed...
Explanation:
~`: set Current to the ` character.
/3: put the ` character into slot 3
^3: increment the character in slot 3 by 1
\3: put the character in slot 3 into Current
o: prints Current
Game Maker Language, 26 bytes
So lucky that the command is chr() instead of char()...
get_string('',chr(33*3-2))
Basically, we have to get chr(65) or chr(97) to get A or a. Also, I had to use get_string to show the output since return, show_message, show_question, etc. all contained restricted characters.
Vim, 16 13 11 10 keystrokes
Thanks to H Walters for saving two keys
Thanks to DJMcMayhem for saving another!
:h%<cr>jvyZZp
:h%<cr> #open help for percent
jvy #move down one char (to the letter "a"), visual mode the character, yank
ZZ #exit help for percent
p #put yanked character
Perl6, 20
(?0).comb[3>2].print
JavaScript (ES6), Uppercase, 34 30 bytes
1. I started from the answers of Conor O'Brien to get this:
_=>this[`${` ${-$}`[2]}tob`]("QQ")
Since btoa("A") gives "QQ==", it's doing atob("QQ") wich gives "A".
2. Completing the answer of chronixlol :
_=>String.fromCodePoint(88-23)
MIXAL - 101 bytes including tabs
Run on your MIX machine. Or assemble and run using the GNU MIX Development Kit (http://www.gnu.org/software/mdk/).
S ENT2 2/2
ST2 8
ENT3 22*2-3-2-2
ST3 P(8-3:8-3)
ENT2 22-3
ST2 P(8-2-2:8-2-2)
P IN 8
HLT
END S
The biggest challenge is not being able to use OUT, the only output command, or 19, the number of the teletype output device. I get around the source restrictions by creating forbidden numbers using MIX assembler arithmetic, and by using MIX's self-modifying code features.
- Enter the number 1 into index register 2 (assembler turns
2/2into1) - Store the contents of index register 2 at memory address 8, later to be sent to the output device
- Enter the number 37 into index register 3 using assembler arithmetic. 37 is the operation code
OUT, which we need but can't use because it has aU. - Store the contents of index register 3 (=37) in the opcode field (
5:5) of the instruction already stored at address 'P' as part of the program (in other words, changeINtoOUT) - Enter the number 19 into index register 2. The teletype output device is no. 19.
- Store the contents of index register 2 (=19) in the field-specification field (
4:4) of the instruction at address 'P' (change0to19to specify the teletype device as output). - Instruction 'P': We have now rewritten this line as
P OUT 8(19). So, send the contents stored at address 8 (=1= character code for'A') to the teletype device for output. - Stop the machine.
MSX-BASIC, 25 bytes
?CHR$(3*3*3*2-(-3-3-3-2))
Python 3, 18 17 bytes
print(chr(88-23))
Prints the Unicode value 0x41 = 65 - credit SnoringFrog
Previous answers
print(str(int)[3])
Prints index 3 (the fourth character) of the string "<class 'int'>":
print(chr(33*3-2))
Prints the Unicode value 0x61 = 97
Javascript, 32 bytes
Uppercase A:
String.fromCodePoint(33*2-(3-2))
Lua, 36 bytes
This one took me a while since MANY of the standard Lua functions are taken away from the rules (all of math, string.char, string.match, pairs, even next)
This takes advantage of the fact that Lua has a global _VERSION that usually starts with "Lua" (e.g., Lua 5.1, or similar for other versions), so unless this is run on a non-mainstream interpreter, the third character will be an 'a'
print(({_VERSION:find("..(.)")})[3])
The {...}[3] is to group the results of find which also includes the indices where it matched, and then return the third item which is the matched character (the a)
Pluso, 1 byte
o
Pluso contains a single accumulator, that starts with the value 1. It uses two commands, p which increments the accumulator (mod 27), and o which prints the current value as an uppercase ASCII character, A-Z or space (where 1-26 represents A-Z respectively, and 0 represents space).
As the accumulator starts at 1, the command o with no prior p will output A.
Java, 55 bytes
void f(){System.err.write('c'-2);System.err.println();}
Since the code has to print it, one of the two built-in writers are required. System.out is, well, out, because it contains u. System.err works, however.
The next hurdle is Java's handling of char and int. Since it is not allowed to cast to char because it contains a, and because 'c' - 2 gets promoted to int, another mechanism is required. System.err is a PrintWriter, which has a write(char) method but not write(int). Putting 'c' - 2 in there forces it to char without a cast.
Finally, every time I ran the program the buffer for System.err would not flush like it is supposed to, and the program printed nothing. So I had to flush it manually. However, System.err.flush() is not allowed, so I called println() which implicitly flushes the underlying stream.
Whitespace, 15 bytes
It's easy to avoid characters with a language that doesn't use any of them!
.
.
.
The .'s are unneccessary, and are just to make the codeblock work.
For a more readable format: s = space, t = tab, newline placement matters
ssstssssst
t
ss
First line pushes (ss) positive (s) 65 (tssssst, binary 1000001) onto the stack)
Second and third lines print top of stack as char.
3d, 7 bytes
Don't know if competing, but still, here it is.
Program:
>'b.-!;
Output:
a
Explanation:
> Set direction of the IP
'b Push Unicode ordinal of character 'b'
. Push digit 1
- Push difference
! Print as Unicode character
; End of program
PHP, 15 14 bytes
(PHP7 only) Longer than others but a tricky approach :
<?=([].b)[.2];
[] instance an Array
.b cast to string = 'Array' and add any character (here b) at the end (thank you Business Cat)
[.2] : = [0] take first letter (A)
C# Interactive (REPL), 12 bytes
Lower case:
$"_{3<2}"[2]
This works by getting the third character from the string _False.
Upper case:
$"{new{}.GetType()}"[8-3]
This creates an anonymous object and gets its type, which is always of the form <>f__AnonymousType0#9. It then turns this into a string and gets the 6th character.
Answers are given as C# Interactive to compete with the other C# answer, though they can easily be converted to a printing anonymous lambda by wrapping them with:
()=>System.Console.Write(...);
This adds 27 characters to each solution.
Commodore 64 BASIC, 6 bytes
2?"♠"
There's a non-printing character after the first quotation mark, with byte value 14.
How this works: The Commodore 64 has two character sets: "shifted mode" (which contains the full upper- and lower-case alphabet, and the startup "unshifted mode", which contains the upper-case alphabet and a selection of symbols. The "spade" symbol in unshifted mode has the same byte value as uppercase "A" in shifted mode, so if you switch modes before printing out a "♠", you get the letter "A" instead.
The question now becomes: what's the most efficient way of switching modes? The "approved" method is POKE 53272,23, but that's rather long for code golf. There's a control character (byte value 14) that switches to shifted mode, but you can't type it in directly, and ?CHR$(14) is still rather long. Further, both of these contain disallowed characters, and working around that would expand them quite a bit.
You can cut it down to a single byte, though, by combining it with the code to print out the "A". The Commodore has no memory protection, so after typing in a proxy program (I used 2?"Q♠"), you can modify the in-memory representation to replace the "Q" with byte value 14. For a freshly-started C64, POKE 2055,14 will do the job.
Python 2, 14 bytes
print`3<3`[~3]
The expression 3<3 gives the Boolean False, and the backticks give its string representation 'False'. From here, it remains to extract the letter a. Python is 0-indexed, so the a is at index 1, which is a banned character. It can be expressed as 3-2, but there's a shorter way. Python allows indexing from the back, with index -1 for the last entry, -2 for the one before it, and so on. We want index -4, but 4 is also a banned number. But, we can express it as ~3 using the bit-complement ~, which gives -n-1 for ~n.
Mathematica, 16 bytes
First@WordList[]
WordList[] gives a list of common English words. First takes the first element of this list, which is "a".
dc, 4 bytes
833P
UCHAR_MAX overflow rolls through the table six three times before landing at 65.
Oracle SQL 11.2, 56 50 bytes
Shorter way to compute 65, thanks to the previous answers using it.
SELECT NVL(MIN('.'),CHR(88-23))FROM col WHERE 2=3;
Old version :
SELECT NVL(MIN('.'),CHR(3*3*8-2-2-3))FROM col WHERE 2=3;
Ugly, but I had to find a way around DUAL
Labyrinth, 6 5 bytes
833.@
Explanation
833 # push 833 to stack
. # print modulo 256 as byte
@ # exit
Saved 1 byte thanks to Martin Ender.
Senva, 9 bytes 4 bytes
There is two ways to write this program, let's begin by the longest :
82.8--8-~
This stores 82 in the memory, substract 8, 8 again, 1, then display the memory as an ASCII char (65 is the ASCII code of A). The cell's value is 82 - 8 - 8 - 1 = 65.
The second way is a little bit pernicious :
B_-~
This converts the 'B' character to its ASCII char code, substract 1, and then display it as an ASCII char.
PHP, 12 bytes
<?=chr(833);
Due to an overflow the above produces an 'A' (see example 2 of the PHP doc).
Retina, 8 bytes
M`
T`O`L
Explanation
M`
This counts the number of matches of the empty regex in the empty input, so it produces a 1.
T`O`L
This is a transliteration which substitutes characters from the first set with corresponding characters from the second set. However, O and L are shorthands which expand to the odd digits and the upper case alphabet, respectively, so this replaces the 1 with A.
3var, 14 11 8 bytes
iii # set A to 3
s # square A to 9
d # decrease A to 8
s # square A to 64
i # increment A to 65
P # print A as ascii
Saved 3 bytes thanks to Joffan.
Python 2, 16 bytes
print chr(88-23)
Simpler but longer (21 bytes):
print chr(ord('c')-2)
C# Interactive (REPL), 21 bytes
(3<2).ToString()[3-2]
I really wonder how much smaller it can become in C# in a REPL environment.
Fission, 5 bytes
R'B_O
How it works
R Spawn an atom that moves to the right.
'B Set the atom's mass to 'B'.
_ Decrement the atom's mass.
O Print the character that corresponds to the atoms mass and destroy the atom.
WolframAlpha, 10 bytes
chr(88-23)
dc, 8 7 bytes
-1B thanks to Dennis
88 23-P
Pushes 88, pushes 23, subtracts, leaving 65. Print top of stack (65) as an ASCII string, sans trailing newline.
Edit:
These are a few of the other ways I came up with. It basically became a game of "generate the numbers 65 and 97 using only [238B-F] and without addition". Ironically, I find the longest ones most interesting.
_Fdd/r-oC 2-n # involves changing the base
2_2/8d*3*2/-P
Idd2/2/-2*on # also changes base
2d8r^r_2/-P
8d*2_2/-P
B 3d**2-P
33 3*2-P
Bash, 19 17 bytes
Prints lower-case a:
printf \\$[282/2]
(Thanks to Dennis for reminding me of the deprecated syntax)
JavaScript (ES6), 17 16 14 bytes
Saved two bytes thanks to Neil!
_=>` ${-_}`[2]
Returns the second character of NaN, which is a.
This is the shortest I could come up with for A, 43 42 bytes:
_=>`${[][`constr${`${!_}`[2]}ctor`]}`[-~8]
Who says being an obfuscator doesn't help with code golf? Not I!
Explanations
The first one, in depth.
_=>` ${-_}`[2]
-_ is NaN, because _ is undefined. To get this as a string, one would need one of the following:
-_+""
`${-_}`
(-_).toString()
The last is too long, and the first uses +. So we use the second one. Now, the a is at index 1. This isn't any good, because 1 is forbidden. However, being a template string, we can put a space in there to make it at index 2, thus leaving us with ` ${-_}`.
The second one, in depth.
_=>`${[][`constr${`${!_}`[2]}ctor`]}`[-~8]
This one was a doozy.
_=>` `[-~8]
This is the 9th character of the inside template string, -~8 being equal to 9. In this case, this template string is just for stringification. This is the inside equation being stringified, in between ${...}:
[][`constr${`${!_}`[2]}ctor`]
Let's expand this a bit:
(new Array())[`constr${`${!_}`[2]}ctor`]
This gets the property `constr${ from an empty array. This property is, of course, a template string, but it has some text around it. It's roughly equivalent to:${!""}[2]}ctor`
"constr" + `${!_}`[2] + "ctor"
The inside is in turn equivalent to:
(!_).toString()[2]
!_ is true (because _ is undefined, and !undefined === true), and stringified is "true". We get the second character of it, u; we have to get it this way to avoid explicitly putting u in our code.
So, this inside bit is equivalent to:
"constr" + "u" + "ctor" === "constructor"
So we are getting the constructor of the Array, the Array function. I couldn't put this down explicitly because it contains the forbidden A. Now, stringifying the Array function yields "function Array() { [native code] }".
Back to the original code:
_=>`${[][`constr${`${!_}`[2]}ctor`]}`[-~8]
This is equivalent to, as we've seen:
_=>Array.toString()[-~8]
Equivalent to:
_=>Array.toString()[9]
Finally equivalent to:
_=>"A"
reticular, 9 bytes
"C"c2-co;
This is basically C converted from a char to a char code, subtracting two, converting back to a char, printing it with o, then finally terminating it with ;.
Ruby, 20 Bytes
print ("c".ord-2).chr
Subtracts 2 from the unicode-code from "c".
ECMAScript 6, 41 59 55 bytes
Golfed
This is the golfed version, which doesn't support the use strict pragma. If you want to allow this to be compatible with it, simply replace s=(2-2>(3-2) with var s=(2-2)>(3-2).
Version 3 of this replaced the old substring (that uses the disallowed character u) with slice, a byte-efficient version that fits these rules.
You can try this on JSFiddle or use the below Stack Snippet.
s=(2-2)>(3-2);console.log(s.toString().slice((3-2),2));
Ungolfed
This version of golfed code (version 3) supports the use strict pragma and is 79 bytes.
You can try this on JSFiddle or use the below Stack Snippet.
"use strict";
var s = (2-2) > (3-2);
console.log(s.toString().slice((3-2), 2));
Technically, this doesn't follow the rules as it uses u and a (in use and var respectively), but it was needed to support use strict.
Javascript, 18 bytes 16 bytes 12 bytes 11 bytes
` ${!2}`[2]
Based on modified jsfuck basics (had to figure out how to replace + with -).
Ungolfed?
Well, at least a version with comments (note that this version will probably not run):
` ${ // whitespace to make "a" the third letter
!2 // returns false
}` // convert to string "false"
[2] // index the third letter in " false" (note the whitespace)
Old solution:
`${![]}`[-(-!![])]
VBA, 12 bytes
?Chr(88-23);
in the VBA Immediate window.
Befunge-98, 6 bytes
'Lb-,q
Very basic: 'Lb- pushes (76-11 aka 65), , prints, q quits because using @ is too boring.
Brachylog, 4 bytes
@Ztw
Explanation
@Z The string "zyxwvutsrqponmlkjihgfedcba"
tw Write the last element to STDOUT
Lua, 36 bytes
_,_,y=type{}:find(".(.)")io.write(y)
Explanation:
type{}is equivalent totype({})and returns the string"table"with the desired 'a'.string.find's very infrequently-used 3rd return value is the first capture from the pattern. Most of the other ways that could be used to chop up a string are forbidden by the alphabet restrcitions.
Comments:
Alternatively, print for -3 bytes if not required to suppress the trailing newline.
I really wanted to use _VERSION to get the 'a', but type{} is shorter.
This should work in Lua 5.1-5.3. Lua 5.0 doesn't support the string metatable, so it is a bit longer.
Brachylog, 7 bytes
@P:33mw
Explanation
@P is the following string:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
(the first character is a space)
And its 33rd element is the required letter A.
@P:33mw
@P generate the string above
:33 append the number 33, yielding ["...",33]
m pass the array as Input of m, and the
required character becomes the Output
w recycles the right argument of the previous
predicate as the left argument, and then
prints to STDOUT
Ruby, 17 bytes
print (88-23).chr
Thanks to Dennis for the expression, a big improvement over 23*8/2-3*8-3, my first idea.
PHP, 14 bytes
<?=chr(88-23);
88 - 23 = 65, the ASCII value of A. 8, 2, and 3 are the only legal digits to use, and - is allowed.
Deadfish~, 8 bytes
iiisdsic
The only difference from regular Deadfish is that it uses c, which outputs the accumulator as a character instead of an integer.
Explanation
increment 3 times (3)square (9)decrement (8)square (64)increment (65)- Output as a
character ("A")
Dyalog APL, 15 bytes
{⍵::2⌷⊃⎕DM⋄⍺}⍴⍬
The straightforward options are all banned: both ⎕AV (APL character set vector) and ⎕UCS (Unicode conversion) contain banned characters.
It gives one uppercase A:
{⍵::2⌷⊃⎕DM⋄⍺}⍴⍬
A
Explanation:
{...}⍴⍬: pass 0 (length of empty vector) into the function⍵::: trap the error with code⍵, which will be 0. A trap on 0 means to trap all errors.2⌷⊃⎕DM: the 2nd character of the first line of the error message⋄⍺: try to return the value of the left argument. There isn't one, so this will raise aVALUE ERROR, which theAis then extracted from.
C, (19?) 24 bytes
Thanks to Dennis:
f(){printf("%c",88-23);}
same length:
f(){printf("%c",'C'-2);}
which enables also lowercase:
f(){printf("%c",'c'-2);}
There is a 19 bytes solution as a function modifying its parameter, which has a flaw:
g(int*p){*p='C'-2;}
//Usage:
main(){
int c; //cannot be char
g(&c);
printf("%c\n",c);
}
If c was declared char, g modifies the whole int so it smashes the stack which causes other values to be modified or the programm to abort with an error message. The only way to circumvent is to declare int c; in main and print with "%c", but that feels like a loophole.
older solutions
f(){printf("%c",'B'-2/2);} //26 bytes
f(i){i='B';printf("%c",--i);} //29 bytes
f(){int*i="B";int j[]={*i-(2/2),2-2};printf("%s",j);} //53 bytes
Just a function, since main is forbidden.
><>, 6 bytes
'|;o-$
this creates a string of characters, bounces and creates it again in reverse, flips the top 2 stack items and subtracts: '|' (124) minus ';' (59) is 'A' (65)
Perl, 9 8 bytes
xor is still allowed, but say isn't. So for 9 bytes:
print$/^K
However using output to STDERR gives 8 bytes:
die~"\x9e\xf5"
Replace \x9e and \xf5 by their literal versions. Or generate the executable file using:
perl -e 'printf q(die~"%s"),~"a\n"' > a.pl
JavaScript (ES6), 21 bytes
_=>(8^2).toString(22)
I originally tried converting false to string to do this, but it took me 23 bytes at the time. I've since come up with a shorter way, which is this for 14 bytes:
_=>`!${!2}`[2]
I don't think you can get an uppercase A under the rules, since you need one of String.fromCharCode or .toUpperCase(), both of which contain a.
Snowman, 14 bytes
{8vn2nPNiNwRsp
Explanation
{ # activate bdg
8 # set b to 8
vn # no-op
2 # set d to 2
nP # set b to 8^2=64
NiN # set b to b+1 = 65
wR # wrap in array
sp # print
Befunge 93, 7 bytes
"C"2-,@
Pretty simple.
MATL, 5 bytes
YNVH)
Explanation
YN % Creates a NaN value (not a number)
V % Convert it to a string
H) % Grab the second letter ('a')
% Implicitly display the result
My original answer was the straight forward approach using the pre-defined literal lY2 which yields 'A'...'Z' and then selecting the first element, 'A'.
lY2l)
Brainfuck, 24 bytes
not as good as Dennis' anyones, but still posting it.
----[---->-<]>--[->-<]>.
SQF, 30 15
Using the function-as-a-file format:
toString[88-23]
Call as: call FUNCTION
Finally a challenge where SQF can compete. Not win, but actually competing is nice.
Jolf, 3 bytes
Fpl
First (F) of the lowercase alphabet (pl).
Are you tired of verifying your code manually? Use this!
~TS
This is the hexadecimal char code of a newline (0x0A)
Hexagony, 4 bytes
Ayyy lmao? Quite golfy for a non-golfing language haha. Code:
B(;@
A more readable form:
B (
; @ .
. .
This puts the ASCII value of the letter B, which is 66, on the current memory edge. It substracts it by one using ( and prints it with ;. After that, the program is terminated using @.
Obligatory path image:
05AB1E, 3 2 bytes
Th
Explanation
T # push 10
h # convert to hex
Saved 1 byte thanks to Adnan
Jelly, 3 bytes
ØWḢ
How it works
ØWḢ Main link. No arguments.
ØW Yield "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_".
Ḣ Head; extract the first character.
Jelly, 4 bytes
l-ṾṂ
How it works
l-ṾṂ Main link. No arguments.
l- Take the logarithm of 0 with base -1. Yields (nan+infj).
Ṿ Uneval; yield the string representation, i.e., "nanıinf".
Ṃ Take the minimum, returning 'a'.
Pyth, 2 bytes
hG
Test it in the Pyth Compiler.
How it works
G Yield the lowercase alphabet.
h Extract the first character.
CJam, 3 bytes
'@)
How it works
'@ Push the character '@' on the stack.
) Increment its code point, yielding 'A'.




