74
\$\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\$
  • 7
    \$\begingroup\$ @ColdGolf You seem to be saying "yes" to functions, but functions don't display, they usually return. \$\endgroup\$ – xnor Aug 19 '16 at 23:06
  • 2
    \$\begingroup\$ Is ending up with a variable that contains just a also good enough ? \$\endgroup\$ – Ton Hospel Aug 19 '16 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 Aug 20 '16 at 0:05
  • 1
    \$\begingroup\$ Why those particular characters? \$\endgroup\$ – user253751 Aug 22 '16 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\$ – Mego Aug 22 '16 at 6:26

183 Answers 183

1
3 4 5
6
7
0
\$\begingroup\$

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.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Pyth, 6 bytes

C-*TT3

Try It Online

Explanation

C         ASCII integer to character
  -*TT3    (Ten*Ten)-3 (97)
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

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.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

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);
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ turning off errors is not necessary: omitting the quotes will yield a notice; those are not printed with default settings. \$\endgroup\$ – Titus Nov 11 '16 at 14:30
0
\$\begingroup\$

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'
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Forth, 19 bytes

Creates the number 65 (23*3-2-2), then outputs it as the character A.

23 3 * 2 - 2 - emit

Try it online

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

SmileBASIC, 12 bytes

Self-explanatory.

?CHR$(88-23)
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

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.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

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).

Try it online!

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

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

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

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)
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Recursiva, 4 bytes

Y(L'

Try it online!

Explanation:

Y(L'
Y     - From, Take n-th element 'A'
 (    - Upper-case alphabet 'ABC...Z'  
  L   - Length of i.e. 0
   '  - empty string
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

PHP 21 or 67 Bytes

Try it online

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];
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Pepe, 10 bytes

reeEEeeeeE

Try it online!

reeEEeeeeE pushes a to stack and outputs it.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Japt -g, 2 bytes

;B

Test it here

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Aheui (esotope), 21 bytes

밡밤다발따맣홄

Try it online!


Explanation:

밡: push 9, move cursor right by 1(→).
밤: push 4, →
다: add, →
발: push 5, →
따: mul, →
맣: print as character, →
홄: end.
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Lean Mean Bean Machine, 11 bytes

O
"
b
)
!
;

Try it online!

O Spawn a marble,
"b set it to b,
) decrement it,
! print it,
; delete it.

Due to u being disallowed, this is 2 bytes longer than it would otherwise be, as u both prints and deletes the marble.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

J, 14 bytes

{:{:2(3!:3)5*2

Try it online!

Mostly curious if there's a better solution...

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

C# (.NET Core), 44 bytes

Console.Write(Convert.ToString(33-23, 8*2));

Try it online!

Converts the decimal value 10 to its hexadecimal equivalent (a).

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

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. :-)

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

AppleScript, 16

string id(88-23)
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

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.
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Runic Enchantments, 6 bytes

'Bl-k@

Try it online!

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

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

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)

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Julia 1.0, 12 bytes

print('d'-3)

Try it online!

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

BBC Basic IV, 19 15 bytes

23PRINTCHR$(88-23)

Running in an emulator

Older Answer: 19 bytes

23PRINTCHR$(8^2-(2-3))

The statement...

P.TOP-PAGE

...shows the size of the program, which is 19 bytes.

Running in an emulator

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ PRINTCHAR has A inside. \$\endgroup\$ – user85052 Dec 26 '19 at 4:18
  • \$\begingroup\$ It's PRINTCHR$, there is no A. I have a typo and have corrected it. \$\endgroup\$ – Richard Crossley Dec 27 '19 at 0:19
0
\$\begingroup\$

05AB1E, 6 4 bytes

2<.b

Try it online!

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
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ So I assume this is a duplicate of another answer? \$\endgroup\$ – user85052 Dec 25 '19 at 4:13
  • \$\begingroup\$ @a'_' I'm not allowed to use 1 EDIT: just found a better solution \$\endgroup\$ – Sagittarius Dec 27 '19 at 1:02
0
\$\begingroup\$

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.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ What might make this non-competing? \$\endgroup\$ – pppery Dec 31 '19 at 16:19
  • \$\begingroup\$ @pppery For being a language invented in December 2019. I have heard that such restriction is removed, but the challenge was posted in 2016 so I doubt whether the change is applicable here. \$\endgroup\$ – Shieru Asakoto Jan 2 at 4:50
  • 1
    \$\begingroup\$ That rules change does in fact apply to challenges that predate it. \$\endgroup\$ – pppery Jan 2 at 12:33
  • \$\begingroup\$ But 加陰以""夫其之2書之 is only 27 bytes. \$\endgroup\$ – tsh Jun 12 at 2:43
0
\$\begingroup\$

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


Try it online!

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

i like frog, 37 bytes

like frog i like i like frog i frog i

I like outputs the parameters after converting the parameters to binary.

The params work like this:

If the last used word was "i"

0 = like

1 = frog

If the last used word was "like"

0 = i

1 = frog

If the last used word was "frog"

0 = i

1 = like

This can be simply converted back to binary.

Additional notes: I'm glad I tried making this language's syntax ridiculous, no weird characters and numbers.

| improve this answer | |
\$\endgroup\$
1
3 4 5
6
7

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