88
\$\begingroup\$

Your task is to display the letter "A" alone, without anything else, except any form of trailing newlines if you cannot avoid them, doing so in a program and/or snippet. Code that returns (instead of printing) is allowed.

Both the lowercase and uppercase versions of the letter "A" are acceptable (that is, unicode U+0061 or unicode U+0041. Other character encodings that aren't Unicode are allowed, but either way, the resulting output of your code must be the latin letter "A", and not any lookalikes or homoglyphs)

You must not use any of the below characters in your code, regardless of the character encoding that you pick:

  • "A", whether uppercase or lowercase.

  • "U", whether lowercase or uppercase.

  • X, whether uppercase or lowercase.

  • +

  • &

  • #

  • 0

  • 1

  • 4

  • 5

  • 6

  • 7

  • 9

Cheating, loopholes, etc, are not allowed.

Since this is , the shortest solution, in bytes, that follows all the rules, is the winner.


Validity Checker

This Stack Snippet checks to make sure your code doesn't use the restricted characters. It might not work properly for some character encodings.

var t = prompt("Input your code.");

if (/[AaUuXx+&#0145679]/.test(t)) {
  alert("Contains a disallowed character!");
} else {
  alert("No disallowed characters");
}

This Stack Snippet that makes sure you don't have a disallowed character is also available on JSFiddle.

Leaderboard

var QUESTION_ID=90349,OVERRIDE_USER=58717;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>

\$\endgroup\$
10
  • 7
    \$\begingroup\$ @ColdGolf You seem to be saying "yes" to functions, but functions don't display, they usually return. \$\endgroup\$
    – xnor
    Commented Aug 19, 2016 at 23:06
  • 2
    \$\begingroup\$ Is ending up with a variable that contains just a also good enough ? \$\endgroup\$
    – Ton Hospel
    Commented Aug 19, 2016 at 23:17
  • 1
    \$\begingroup\$ That's not what I meant. The supposed code doing a variable assignment would not contain any of the forbidden characters. I'm just trying to understand what is covered by "display by means other than printing". If "return from a function" is OK, what about "assign to a variable" ? \$\endgroup\$
    – Ton Hospel
    Commented Aug 20, 2016 at 0:05
  • 1
    \$\begingroup\$ Why those particular characters? \$\endgroup\$ Commented Aug 22, 2016 at 1:32
  • 7
    \$\begingroup\$ @immibis A for obvious reasons. U for Unicode escape strings (\u0041 is A), X for hex escape strings (\x41), + for Unicode ordinals (U+0041), & for HTML entities, # for I actually don't know, 65 is the decimal ordinal of A, 41 is the hex ordinal of A, 97 is the decimal ordinal of a, and 0 for a few of the previous reasons. \$\endgroup\$
    – user45941
    Commented Aug 22, 2016 at 6:26

229 Answers 229

1
2
3 4 5
8
6
\$\begingroup\$

Bash, 14 13 bytes

tr PQ @-B<<<Q

Output:

A
\$\endgroup\$
2
  • \$\begingroup\$ 13 bytes: tr QQ @-B<<<Q \$\endgroup\$
    – pxeger
    Commented Nov 7, 2020 at 18:54
  • \$\begingroup\$ @pxeger Nice find! The last char in SET2 will be ignored, which is fine, we need the first 2 chars only for this to work. Thanks. \$\endgroup\$
    – seshoumara
    Commented Nov 8, 2020 at 12:34
6
\$\begingroup\$

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.

Try it online!

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}
\$\endgroup\$
2
  • 1
    \$\begingroup\$ Using carriage return to overwrite the output previously written you can reduce it to 20 bytes: echo -e \\r{Y..b..8} \$\endgroup\$
    – DPD-
    Commented Jul 21 at 21:36
  • 1
    \$\begingroup\$ Thanks @DPD- - in fact I was able to use your technique to get an even shorter answer. \$\endgroup\$ Commented Jul 23 at 15:57
5
\$\begingroup\$

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")
\$\endgroup\$
5
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ Wow, exactly 1k ! Should I upvote? \$\endgroup\$ Commented Aug 25, 2016 at 16:01
  • \$\begingroup\$ @NoOneIsHere: Go ahead, or I'll never get past it :) \$\endgroup\$ Commented Aug 25, 2016 at 16:15
5
\$\begingroup\$

VBA, 12 bytes

?Chr(88-23);

in the VBA Immediate window.

\$\endgroup\$
2
  • \$\begingroup\$ You could remove ; to make it 11 bytes \$\endgroup\$ Commented Aug 20, 2016 at 22:03
  • \$\begingroup\$ @Anastasiya-Romanova秀 ...except the instructions say to avoid a linefeed if you can. \$\endgroup\$
    – Joffan
    Commented Aug 21, 2016 at 2:53
5
\$\begingroup\$

Dyalog APL, 12 bytes

⊃⎕DR/88-8 23

Equivalent to 80 ⎕DR 65

\$\endgroup\$
5
\$\begingroup\$

Labyrinth, 6 5 bytes

833.@

Explanation

833     # push 833 to stack
    .   # print modulo 256 as byte
     @  # exit

Try it online

Saved 1 byte thanks to Martin Ender.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Actually making use of that modulo: 833.@ \$\endgroup\$ Commented Aug 21, 2016 at 12:57
  • \$\begingroup\$ @MartinEnder: Brilliant! \$\endgroup\$
    – Emigna
    Commented Aug 21, 2016 at 17:41
5
\$\begingroup\$

dc, 4 bytes

833P

UCHAR_MAX overflow rolls through the table six three times before landing at 65.

\$\endgroup\$
5
\$\begingroup\$

Mathematica, 16 bytes

First@WordList[]

WordList[] gives a list of common English words. First takes the first element of this list, which is "a".

\$\endgroup\$
3
  • \$\begingroup\$ Is WordList guaranteed not to change in a newer Mathematics update? \$\endgroup\$ Commented Aug 22, 2016 at 20:23
  • 1
    \$\begingroup\$ @ColdGolf It doesn't matter if it's updated. As long as any version of the language (i.e. any given interpreter or compiler) correctly runs this code, the answer is valid as far as PPCG is concerned. Otherwise, no answer would be valid since we couldn't be sure that any answer would still work in any future update of any language, since the authors of those languages are free to make changes that break backwards-compatibility. \$\endgroup\$ Commented Aug 22, 2016 at 21:44
  • 2
    \$\begingroup\$ @ColdGolf Wordlist is lexigraphically sorted. The only word that could come before "a" is "". \$\endgroup\$
    – Taemyr
    Commented Aug 24, 2016 at 13:36
5
\$\begingroup\$

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.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Take the False value using a simple constant: "$(!2)"[$?] (11 bytes) \$\endgroup\$ Commented Aug 29, 2016 at 13:26
  • \$\begingroup\$ I posted this: [Convert]::ToString((8-3)*2,16) then scrolled through and was like daheck, does "$(!2)"[$?] actually work!? \$\endgroup\$ Commented Oct 7, 2016 at 0:39
5
\$\begingroup\$

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
\$\endgroup\$
8
  • \$\begingroup\$ Could you elaborate on the unprintable characters part? \$\endgroup\$ Commented Aug 19, 2016 at 22:55
  • \$\begingroup\$ @ColdGolf Binary Sesos isn't a character based language; it stores its source code in form of a little-endian base-256 integer. \$\endgroup\$
    – Dennis
    Commented Aug 19, 2016 at 23:12
  • 2
    \$\begingroup\$ Hmm... I'd say the assembly code is the source code of that program and it uses "a" and "6", which are forbidden. Otherwise everybody might just compile their program to an x86 binary and voilà, no forbidden characters used! \$\endgroup\$
    – YetiCGN
    Commented Aug 19, 2016 at 23:40
  • 4
    \$\begingroup\$ @YetiCGN Submitting binary programs is perfectly acceptable. \$\endgroup\$
    – Dennis
    Commented Aug 21, 2016 at 6:39
  • 1
    \$\begingroup\$ @YetiCGN TIO doesn't support binaries right now. I've added a note to the link. \$\endgroup\$ Commented Aug 21, 2016 at 22:09
4
\$\begingroup\$

Java 9 jshell, 18 bytes

printf("%c",'C'-2)

jshell is a Java REPL that comes with Java 9.

\$\endgroup\$
4
\$\begingroup\$

Brachylog, 7 bytes

@P:33mw

Try it online!

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
\$\endgroup\$
4
\$\begingroup\$

Bash, 19 17 bytes

Prints lower-case a:

printf \\$[282/2]

(Thanks to Dennis for reminding me of the deprecated syntax)

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

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
\$\endgroup\$
0
4
\$\begingroup\$

Retina, 8 bytes

M`
T`O`L

Try it online!

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.

\$\endgroup\$
4
\$\begingroup\$

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.

\$\endgroup\$
4
\$\begingroup\$

Whitespace, 15 bytes

It's easy to avoid characters with a language that doesn't use any of them!

Try it online!

.               
.   
.  

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.

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

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])
\$\endgroup\$
1
  • 1
    \$\begingroup\$ I love how you did it. 297 = 3*3*33 \$\endgroup\$
    – Masclins
    Commented Aug 30, 2016 at 10:55
4
\$\begingroup\$

Vim, 19 bytes (not competing)

:redi@"|Ni!<CR>pJd3w~D

Do you demand a shrubbery?

\$\endgroup\$
4
\$\begingroup\$

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

\$\endgroup\$
4
\$\begingroup\$

R, 11 bytes

el(LETTERS)

el(LETTERS) is equivalent to LETTERS[[1]].

Try it online!

\$\endgroup\$
4
\$\begingroup\$

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

Try it online!

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.

\$\endgroup\$
4
\$\begingroup\$

Groovy, 9 bytes

f={--'B'}

Try it online!

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')
\$\endgroup\$
3
\$\begingroup\$

Jolf, 3 bytes

Fpl

Try it here!

First (F) of the lowercase alphabet (pl).


Are you tired of verifying your code manually? Use this!


Another one for three bytes:

~TS

This is the hexadecimal char code of a newline (0x0A)

\$\endgroup\$
3
\$\begingroup\$

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

Try it online

\$\endgroup\$
1
  • 2
    \$\begingroup\$ ......You rang? \$\endgroup\$
    – user18932
    Commented Aug 23, 2016 at 15:24
3
\$\begingroup\$

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 a VALUE ERROR, which the A is then extracted from.
\$\endgroup\$
3
\$\begingroup\$

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.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You can replace print with $><< for -2 bytes. \$\endgroup\$
    – Jordan
    Commented Aug 20, 2016 at 7:01
  • 1
    \$\begingroup\$ (88-23).chr""<<88-23. Sadly when you combine it with $><< as suggested by @Jordan, you have to make sure the second << gets evaluated first. Fortunately that can be solved without enclosing it in parenthesis: just use the first << as method, not as operator: $>.<<""<<88-23. \$\endgroup\$
    – manatwork
    Commented Aug 20, 2016 at 18:17
3
\$\begingroup\$

Lua, 36 bytes

_,_,y=type{}:find(".(.)")io.write(y)

Explanation:

  • type{} is equivalent to type({}) 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.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ _,_,z=type{}:find".(.)"print(z) 31 bytes \$\endgroup\$ Commented Aug 27, 2016 at 13:24
3
\$\begingroup\$

Pyke, 2 bytes

Gh

Try it here!

Gh - alphabet[0]
\$\endgroup\$
1
2
3 4 5
8

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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