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
4 5 6 7
8
0
\$\begingroup\$

Pxem, 6 bytes: filename.

First two characters are as escaped notation.

\303\003.$.p

Try it online!

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

Lean Mean Bean Machine, 11 9 bytes

O
"
b
)
!

Try it online!

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

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

Python 3, 33 bytes

print(chr(223-33-33-33-33--3--3))

Try it online!

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

StupidStackLanguage, 9 bytes

rvvddqmif

Try it online!

Explanation

r         # push length of stack (0)
 vvdd     # push 8 to stack
     qm   # square
       i  # increment
        f # print as ASCII
\$\endgroup\$
0
\$\begingroup\$

Flobnar, 8 bytes

!g<
@:*,

Try it online!

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
\$\endgroup\$
2
  • \$\begingroup\$ what about 88-23 \$\endgroup\$ Commented Apr 12, 2023 at 15:21
  • \$\begingroup\$ @Hippopotomonstrosesquipedalian Flobnar doesn't have two-digit number literals. \$\endgroup\$
    – Bubbler
    Commented Apr 12, 2023 at 23:13
0
\$\begingroup\$

Thunno, \$ 5 \log_{256}(96) \approx \$ 4.12 bytes

Z23-C

Attempt This Online!

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

Attempt This Online!

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

Attempt This Online!

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
\$\endgroup\$
2
  • \$\begingroup\$ How does the character encoding work in this language? it's physically impossible to have a fraction of a bit! \$\endgroup\$ Commented Apr 12, 2023 at 15:13
  • \$\begingroup\$ @Hippopotomonstrosesquipedalian it doesn't actually have a fraction of a bit. It's just an approximation of how much it would take up, since Thunno uses only the 96 printable ASCII characters. It's allowed by Meta rules. \$\endgroup\$
    – The Thonnu
    Commented Apr 12, 2023 at 15:34
0
\$\begingroup\$

Fig, \$3\log_{256}(96)\approx\$ 2.469 bytes

[cB

Try it online!

Didn't see that there was another Fig answer, but here's a different version.

[cB
 cB # "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
[   # First char of the above
\$\endgroup\$
0
\$\begingroup\$

GolfScript, 7 bytes

'B'{(}%

Try it online!

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

Python 3, 17 Bytes

print(chr(88-23))

$$88-23=65$$

\$\endgroup\$
1
0
\$\begingroup\$

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,"

  1. 'A' == 65
  2. \$833 \equiv 65\ (\textrm{mod}\ 256)\$

Try it online!

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

Deadfish~, 10 bytes

iisiiiisic

Try it online!

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

JavaScript (Node.js), 23 bytes

_=>`${[].entries()}`[8]

Try it online!

This is my best attempt at getting capital A.

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

R, 37 36 bytes

write(el(strsplit(c(F,""),""))[2],2)

Attempt This Online!

This outputs a capital \$A\$.

F is a short constant for FALSE, here it is converted to a string, splitted into characters and the 2nd letter is output.

R, 37 36 bytes

write(el(strsplit(c(F/F,""),"N")),2)

Attempt This Online! This outputs a lowercase \$a\$.

The expession F/F (a replacement for 0/0) produces NaN ("not a number"), which is converted to a string, both "N"'s are removed and the rest is output.

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

Rattle, 9 bytes

=8--s-$c,

Try it Online!

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

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.

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

Uiua, 4 bytes

-2@C

Try it here!

Subtracts 2 codepoints from the capital letter C.

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

AWK, 21 bytes

END{printf"%c",88-23}

Try it online!

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

iogii, 3 bytes

'B(

run it here!!

Decrements the character B to get A.

\$\endgroup\$
-1
\$\begingroup\$

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.

\$\endgroup\$
1
4 5 6 7
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.