The Letter A without A

72

16

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>

Buffer Over Read

Posted 2016-08-19T21:49:30.360

Reputation: 1 583

7@ColdGolf You seem to be saying "yes" to functions, but functions don't display, they usually return. – xnor – 2016-08-19T23:06:04.653

2Is ending up with a variable that contains just a also good enough ? – Ton Hospel – 2016-08-19T23:17:51.797

1That'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" ? – Ton Hospel – 2016-08-20T00:05:02.067

I was going to post an answer in detour, then I realized the only cell that can print strings is u. :/ – Cyoce – 2016-08-21T06:50:51.123

1Why those particular characters? – user253751 – 2016-08-22T01:32:08.380

7@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. – Mego – 2016-08-22T06:26:11.717

1@Mego don't forget the number "10" cast into hex is "A". --> %x, -~9 – Albert Renshaw – 2017-01-26T04:24:31.970

Aww, impossible in Shakespeare Programming Language because you have to declare Acts – Hello Goodbye – 2019-12-27T14:41:42.000

Answers

92

Pluso, 1 byte

o

Pluso Esolangs Page.

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.

cdw

Posted 2016-08-19T21:49:30.360

Reputation: 936

16Welcome to PPCG! I would recommend putting the explanation in your answer, in case the link dies for whatever reason. – TheBikingViking – 2016-08-22T07:48:14.743

Explanation added. Waiting for moderator approval. – KPM – 2016-08-23T20:22:54.113

2Thanks for the recommendation (and the welcome), I have updated my answer to include a brief explanation. – cdw – 2016-08-24T03:02:15.763

I just upvoted to put you at 666 rep. Sorry about that. – Aidan F. Pierce – 2017-08-25T01:05:39.200

5Doesn't this fail the "is an esolang" test because it can't do primality checking? – Magic Octopus Urn – 2017-10-12T18:52:00.933

156

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.

xnor

Posted 2016-08-19T21:49:30.360

Reputation: 115 687

7That's a really cool solution. Also, couldn't you do [2] instead of [~3]? – James – 2016-08-19T22:11:35.180

6@DJMcMayhem It's 0-indexed unfortunately, it would need [1]. – xnor – 2016-08-19T22:12:46.853

4... why are 1 and 4 'banned' numbers?? – Chris Cirefice – 2016-08-23T21:22:02.157

4The challenge's rules say so. – xnor – 2016-08-23T23:46:48.843

1@ChrisCirefice As to why they're banned my guess is to rule out just using the ascii representation of A or a. – Dason – 2016-08-24T02:25:29.687

1@Dason Whoops I guess I didn't read the problem description well enough... I thought the language didn't allow them! – Chris Cirefice – 2016-08-24T03:17:17.397

20I'm now even considering using "~0" being read as "zero indexed first element from the back". I wonder why we would use "-1" notation in Python.... – PascalVKooten – 2016-08-24T08:36:02.667

1@PascalvKooten Because a negative integer literal is faster than negating a number. Premature optimization all the way. – mbomb007 – 2017-01-17T19:39:19.840

@mbomb007 Indeed, so that's not the real reason. I think this is one of the most elegant codegolfing solution. – PascalVKooten – 2017-01-17T22:31:04.627

I. am. stunned. – RaisingAgent – 2017-01-24T20:50:29.010

66

Pyth, 2 bytes

hG

Test it in the Pyth Compiler.

How it works

 G  Yield the lowercase alphabet.
h   Extract the first character.

Dennis

Posted 2016-08-19T21:49:30.360

Reputation: 196 637

The pyth compiler doesn't seem to be working at all at the moment, might want to change it to a try it online link

– EdgyNerd – 2019-12-29T15:48:53.967

48

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

YetiCGN

Posted 2016-08-19T21:49:30.360

Reputation: 941

An alternative version is f^E^b. – Ismael Miguel – 2016-08-20T00:53:58.230

Yes, the 9-byte solutions are abundant. I started with y^'8' and x^'9', unfortunately numbers have to be cast to string or it will XOR the resulting type will be an integer. – YetiCGN – 2016-08-20T07:39:17.703

24+1 for the face ^_^ – Cyoce – 2016-08-21T06:46:04.423

The 6 Byte version doesn't print A. It prints =A. – UTF-8 – 2016-08-21T09:56:47.127

@UTF-8: How so? I tested it with PHP 5.6.12 as well as PHP 7.0.3, it only outputs "A". The <?= is the shorthand for <?php echo, then there's a bitwise negation operator and the character 0xBE, followed by the necessary semicolon. Where should = come from? Can you show me how to reproduce what you're getting? – YetiCGN – 2016-08-21T20:33:29.477

I tested it on the command line. Take a loot at this screenshot. http://phpfiddle.org yields the same result (screenshot). I'm using PHP 7.0.8, btw. Maybe it's different with PHP 5.

– UTF-8 – 2016-08-21T21:38:39.943

You're right, I can reproduce it on my Linux system while the Windows version doesn't output =. I will look into that.

– YetiCGN – 2016-08-22T08:30:13.173

1

I know the answer to this riddle now: In UTF-8 the "fraction three quarters" codepoint is encoded as two bytes: 0xC2 0xBE, 0xBE being the same as in ISO-8859-1. I noticed that when I saved this to a file on my linux box, which I access via SSH with UTF-8, of course, that the file is 7 bytes. So, save the script with Latin-1 encoding and it will be 6 bytes and not output the = character.

– YetiCGN – 2016-08-22T18:38:10.330

Let´s have a R^B^Q :D – Titus – 2017-08-24T21:57:28.373

42

05AB1E, 3 2 bytes

Th

Explanation

T   # push 10
 h  # convert to hex

Try it online

Saved 1 byte thanks to Adnan

Emigna

Posted 2016-08-19T21:49:30.360

Reputation: 50 798

5Th for two bytes :) – Adnan – 2016-08-19T22:15:54.820

1@Adnan Oh of course. Hex :) – Emigna – 2016-08-19T22:29:41.773

32

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${${!""}[2]}ctor` from an empty array. This property is, of course, a template string, but it has some text around it. It's roughly equivalent to:

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

Conor O'Brien

Posted 2016-08-19T21:49:30.360

Reputation: 36 228

1@ColdGolf It's alright. – Conor O'Brien – 2016-08-19T23:07:24.630

-_ saves you two bytes. – Neil – 2016-08-19T23:49:25.827

@Neil nice, one, thanks! – Conor O'Brien – 2016-08-20T00:06:28.190

2Would it be against the principles of an obfuscator to add an explanation...? I'm curious about how this works. – trichoplax – 2016-08-20T17:47:38.180

2@trichoplax I suppose it wouldn't hurt to reveal my methods here ;) I added an explanation for both. – Conor O'Brien – 2016-08-20T19:48:50.763

Can't you just do the first code then .toUpperCase()? – OldBunny2800 – 2016-08-21T16:54:44.357

1@OldBunny2800 No. a is a forbidden character, and is in toUpperCase. – Conor O'Brien – 2016-08-21T18:26:43.553

Oh , stupid me. – OldBunny2800 – 2016-08-21T18:27:54.577

3I thought this was Perl at first. – Οurous – 2016-08-22T22:51:55.383

Since the question didn't say anything on how it's presented, you could remove the function declaration and replace _ with {}, saving 2 bytes: \ ${-{}}`[2]` – Universal Electricity – 2016-08-23T09:51:40.920

@Unity3D your answer assumes a repl environment. Otherwise, it is neither returned nor displayed. – Conor O'Brien – 2016-08-25T11:08:51.873

32

brainfuck, 16 bytes

-[-[---<]>>-]<-.

This is based on Esolang's brainfuck algorithm for 159.

Try it online!

Dennis

Posted 2016-08-19T21:49:30.360

Reputation: 196 637

3This.... this is wizardry. – Conor O'Brien – 2016-08-19T22:38:19.083

3

This solution uses the cell at index -1, which isn't supported across all brainfuck interpreters and would result in a crash. You can run it here to see https://fatiherikli.github.io/brainfuck-visualizer/#LVstWy0tLTxdPj4tXTwtLg==

– Cody – 2016-08-19T22:55:08.497

37@Cody On PPCG, languages are defined by their implementation. As long as there is one interpreter that behaves as desired, it is a valid solution. – Dennis – 2016-08-19T22:59:35.923

3How hard was it for you to avoid the forbidden characters? – Hagen von Eitzen – 2016-08-23T20:15:42.937

2@HagenvonEitzen I had to dig a bit to find an algorithm that could avoid +. (the shortest way to print A would be >+[+[<]>>+<+]>.), but thanks to list of constants on Esolang, not too hard. – Dennis – 2016-08-23T20:25:40.180

30

Hexagony, 4 bytes

Ayyy lmao? Quite golfy for a non-golfing language haha. Code:

B(;@

Try it online!

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:

enter image description here

Adnan

Posted 2016-08-19T21:49:30.360

Reputation: 41 965

9"more readable" + hexagony = ??? – Not that Charles – 2016-09-14T18:54:47.457

18

Jelly, 3 bytes

ØWḢ

Try it online!

How it works

ØWḢ  Main link. No arguments.

ØW   Yield "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_".
  Ḣ  Head; extract the first character.

Jelly, 4 bytes

l-ṾṂ

Try it online!

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

Dennis

Posted 2016-08-19T21:49:30.360

Reputation: 196 637

1Too bad the second approach is longer. ._. – Dennis – 2016-08-19T22:26:20.980

6Thanks for including the second approach. It's beautiful – trichoplax – 2016-08-20T17:53:23.613

18

Actually, 2 bytes

úF

Try it online!

Explanation:

úF
ú   lowercase English alphabet
 F  first element

Mego

Posted 2016-08-19T21:49:30.360

Reputation: 32 998

are you the author? I haven't seen this language before. – loa_in_ – 2016-08-23T12:52:11.460

I've seen it pop up a couple times in challenges now. I think it has the most clever name of any of the golfing languages on the site :-) I've been watching Suits lately and I find it to be very Harvey. – corsiKa – 2016-08-24T14:52:33.813

17

CJam, 3 bytes

'@)

Try it online!

How it works

'@   Push the character '@' on the stack.
  )  Increment its code point, yielding 'A'.

Dennis

Posted 2016-08-19T21:49:30.360

Reputation: 196 637

12

Bubblegum, 1 byte

"

or

B

Everyone seemed to forget it existed...

jimmy23013

Posted 2016-08-19T21:49:30.360

Reputation: 34 042

Never used Bubblegum before, so perhaps excuse my ignorance, but where can I find the docs for Bubblegum? Also, I tried http://bubblegum.tryitonline.net/ with both your answers, but it doesn't seem to output anything.

– Kevin Cruijssen – 2016-08-22T12:38:07.020

1

@KevinCruijssen Doc: https://esolangs.org/wiki/Bubblegum TIO seemed to accept only the hexdump of the source code, so try it like this: http://bubblegum.tryitonline.net/#code=MDAwMDAwMDogMjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAi&input=

– jimmy23013 – 2016-08-22T12:44:43.530

Ah, that's my problem; not using the hexdump. Thanks and +1 for being the shortest with a single-byte answer (tied with Pluso). – Kevin Cruijssen – 2016-08-22T12:56:46.207

@KevinCruijssen There is a 1 byte Pluso answer. It has some problems with a strange site rule, though. – jimmy23013 – 2016-08-22T12:59:26.373

10

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

Ton Hospel

Posted 2016-08-19T21:49:30.360

Reputation: 14 114

@ColdGolf: That's not clear to me. Do you mean I can use say (contains a) for printing as long as the construction of the argument doesn't use the forbidden characters ? – Ton Hospel – 2016-08-19T23:13:22.320

"However, you must not use any of the below characters in your code:

  • A, whether uppercase or lowercase." From that, I'd print "No using the letter with code point 65";.
  • < – haykam – 2016-08-19T23:22:44.790

@ColdGolf is that meant to answer the question in any way? – hobbs – 2016-08-20T22:55:43.037

10

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

Try it online

torcado

Posted 2016-08-19T21:49:30.360

Reputation: 550

2Nice! I got '$-o;| which is almost the same but without the bouncing. (|;o-$' also works.) – randomra – 2016-08-20T20:32:23.590

1@randomra oh true! that would definitely run faster, so nice job – torcado – 2016-08-21T05:24:15.270

10

Ruby, 15 12 bytes

$><<to_s[-3]

Jordan

Posted 2016-08-19T21:49:30.360

Reputation: 5 001

1You can save 2 bytes changing $><< to p, makes p to_s[-3] – Ephi – 2016-08-22T08:56:09.093

@Ephi p calls inspect on its arguments, so the output will be quoted, which would disqualify it. – Jordan – 2016-08-22T12:56:09.210

I missed that part of the challenge, I'll let those comments as I think it's an interesting information :) – Ephi – 2016-08-22T13:06:25.177

10

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.

user18932

Posted 2016-08-19T21:49:30.360

Reputation:

9

MATL, 5 bytes

YNVH)

Try it Online

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)

Suever

Posted 2016-08-19T21:49:30.360

Reputation: 10 257

9

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:

`${![]}`[-(-!![])]

slebetman

Posted 2016-08-19T21:49:30.360

Reputation: 629

You can replace the parenthesis with a space between the minus signs. – PurkkaKoodari – 2016-08-20T13:44:14.727

@Pietu1998: I noticed that 3 is allowed so replaced the whole thing with boring old 3-2 to get 1 – slebetman – 2016-08-20T14:53:50.277

Saved one byte thanks to Conor O'Brien's answer – slebetman – 2016-08-20T15:03:03.237

1Uh, no offense, but this pretty much is my answer. Except you use false instead of NaN and don't use a function. – Conor O'Brien – 2016-08-21T06:28:20.027

8

><>, 7 4 bytes

Saved 3 bytes thanks to Teal pelican

"-o.

Try it online!

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

Emigna

Posted 2016-08-19T21:49:30.360

Reputation: 50 798

I would have done "B"1-o; – DanTheMan – 2016-08-22T18:36:17.347

@DanTheMan That should have been the more obvious solution. I wonder why I didn't think of that :P – Emigna – 2016-08-22T18:46:53.453

@DanTheMan :- Going off what Dan posted you can reduce this down further to; "1-o;B or even better "+o;& as either case is allowed making this 5 bytes :) - you can even make it 4 bytes with an error; "-o. – Teal pelican – 2017-07-18T15:06:37.883

@Tealpelican: That's brilliant! Using strings are often shortest in challenges like these, but I didn't even consider that :) – Emigna – 2017-07-18T15:29:04.300

Once I saw Dan's comment it reminded me of an older challenge quite like this so just used the same concept :) – Teal pelican – 2017-07-18T15:46:56.273

8

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

Destructible Lemon

Posted 2016-08-19T21:49:30.360

Reputation: 5 908

Very nice approach! – YetiCGN – 2016-08-20T12:19:01.730

2Save 3 bytes; instead of :h<cr>, try :h%<cr>. That's one extra character, but you wind up on the help for %, with your cursor right over an a. So from here you can replace 33ll with j. – H Walters – 2016-08-21T02:30:44.347

Apologies for obvious typo (save 2 bytes) – H Walters – 2016-08-21T03:06:53.327

You can use ZZ instead of :q<cr> to save another one. – James – 2016-08-25T21:12:00.063

8

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

Frédéric

Posted 2016-08-19T21:49:30.360

Reputation: 2 059

1A bit late, but you can save quite a bit with LETTERS[T*T]. T evaluates to 1 when doing numerical operations. – JAD – 2017-01-01T17:30:41.623

I found a shorter solution!

– Giuseppe – 2017-07-18T15:52:04.123

This isn't technically a solution --- it prints '[1] "a"' , rather than just 'a' – JDL – 2017-08-28T22:07:33.917

7

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

FDinoff

Posted 2016-08-19T21:49:30.360

Reputation: 584

I laughed as I read it. This is good work. Great weaponization of something I know, but wouldn't have thought of. – udioica – 2016-10-13T15:50:52.377

6

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.

Neil

Posted 2016-08-19T21:49:30.360

Reputation: 95 035

You can get uppercase a using JSF or a derivative using computed properties – Downgoat – 2016-08-20T02:41:03.967

1@Downgoat Conor O'Brien already showed how. – Neil – 2016-08-20T09:31:53.697

6

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.

Laikoni

Posted 2016-08-19T21:49:30.360

Reputation: 23 676

I don't think this is valid. The task requires to "print" or "display" A. Your functions just returns it and the linked program displays it via putChar which uses u. – nimi – 2016-08-19T22:43:07.420

You're right, however the rules have been updated and now returning from a function seems to be ok. – Laikoni – 2016-08-19T23:02:35.593

No, the rules still say print and/or display. – nimi – 2016-08-19T23:05:25.963

2Dennis asked explicitly whether returning from a function instead of printing is ok and OP replied with yes, but the afterwards updated wording of the question still doesn't reflect this. I guess we still have to wait for further clarification. – Laikoni – 2016-08-19T23:33:03.357

1The OP confirmed that A should be printed/displayed and not returned. – nimi – 2016-08-20T18:49:18.173

6

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.

Cody

Posted 2016-08-19T21:49:30.360

Reputation: 447

1not a serious competitor. If you actually golf it down, the downvoter might invert their vote – Destructible Lemon – 2016-08-19T22:30:51.290

Wouldn't it be much shorter to just count up to 65, even with 65 plusses? – NinjaBearMonkey – 2016-08-19T22:33:46.923

2'+' isn't allowed, so I had to go backwards – Cody – 2016-08-19T22:34:03.883

Sorry, I didn't see that. There's still far shorter ways to make 191, though.

– NinjaBearMonkey – 2016-08-19T22:36:44.803

how do you even post 192 bytes, then post a golfed solution of less than 10% of original? – Destructible Lemon – 2016-08-19T22:49:48.530

@DestructibleWatermelon the 192 byte one is the brute force, obvious solution. As I said, I'm not good at brainfuck. When NinjaBearMonkey posted a list of ways to make other numbers with fewer characters, I modified one of those to do this. The first 16 bytes of my solution are on that page, the last 3 are from me. – Cody – 2016-08-19T22:52:19.943

What is the strikethrough --------------------- for? – haykam – 2016-08-19T23:26:04.313

2That was the 192 byte solution, I just left it up and did the strikethrough instead of deleting it because I thought it was funny going from 192 to 19 – Cody – 2016-08-19T23:30:36.103

6

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.

Karl Napf

Posted 2016-08-19T21:49:30.360

Reputation: 4 131

388-23 should save a few bytes. – Dennis – 2016-08-19T22:43:01.967

For lower case a, you can use (333-33)/3-3. It's not as short as 'c'-2, but it's 3er. 33*3-2 is also possible. – rici – 2016-08-20T19:42:59.370

If you use write() instead of printf you can make it a program; specify the build steps to ensure you don't link against any libc at all; if there is no _start the first symbol is jumped to and _exit is allowed so it's safe. At least one version of gcc will optimize write() into the direct syscall with no function call at all. – Joshua – 2016-08-24T22:58:33.597

Depending on your IDE you can do something like this: printf("%c",~'ɦ');, though the "A" will have an accent mark added heh – Albert Renshaw – 2017-01-24T09:48:17.673

@AlbertRenshaw ɦ is a 2-byte-character – Karl Napf – 2017-01-25T19:49:32.603

@cmaster putchar includes A and U which is both forbidden – Karl Napf – 2017-02-04T11:48:50.353

@KarlNapf Ooops. Missed that. Sorry. – cmaster - reinstate monica – 2017-02-04T21:24:18.227

6

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)

PiGuy

Posted 2016-08-19T21:49:30.360

Reputation: 401

2print(({type{}:find".(.)"})[3]) 31 bytes – Egor Skriptunoff – 2016-08-27T13:14:41.857

5

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...
  • o outputs the top of stack, A.
  • @ terminates the program.

FlipTack

Posted 2016-08-19T21:49:30.360

Reputation: 13 242

2Ha, awesome double use of @ :-) – ETHproductions – 2017-01-18T15:11:36.313

5

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

NinjaBearMonkey

Posted 2016-08-19T21:49:30.360

Reputation: 9 925

Could you elaborate on the unprintable characters part? – Buffer Over Read – 2016-08-19T22:55:58.393

@ColdGolf Binary Sesos isn't a character based language; it stores its source code in form of a little-endian base-256 integer. – Dennis – 2016-08-19T23:12:19.373

@ColdGolf Yes, the three characters that you see are meaningless; what matters is their binary representation. – NinjaBearMonkey – 2016-08-19T23:13:35.460

2Hmm... 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! – YetiCGN – 2016-08-19T23:40:12.010

I agree. It isn't just 'a' is disallowed, its the value of 97 too. Sorry to disappoint. – tngreene – 2016-08-20T07:00:45.247

4@YetiCGN Submitting binary programs is perfectly acceptable. – Dennis – 2016-08-21T06:39:51.253

OK, I've read up about how Sesos SBIN binaries work and I agree. The link is misleading thought, because it contains the assembler source code with the forbidden characters. – YetiCGN – 2016-08-21T20:51:58.450

1@YetiCGN TIO doesn't support binaries right now. I've added a note to the link. – NinjaBearMonkey – 2016-08-21T22:09:47.247

5

Brachylog, 4 bytes

@Ztw

Try it online!

Explanation

@Z      The string "zyxwvutsrqponmlkjihgfedcba"
  tw    Write the last element to STDOUT

Fatalize

Posted 2016-08-19T21:49:30.360

Reputation: 32 976

5

dc, 4 bytes

833P

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

brhfl

Posted 2016-08-19T21:49:30.360

Reputation: 1 291

5

Mathematica, 16 bytes

First@WordList[]

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

user48818

Posted 2016-08-19T21:49:30.360

Reputation:

Is WordList guaranteed not to change in a newer Mathematics update? – Buffer Over Read – 2016-08-22T20:23:25.117

1@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. – Martin Ender – 2016-08-22T21:44:44.020

2@ColdGolf Wordlist is lexigraphically sorted. The only word that could come before "a" is "". – Taemyr – 2016-08-24T13:36:11.130

4

R, 11 bytes

el(LETTERS)

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

Try it online!

Giuseppe

Posted 2016-08-19T21:49:30.360

Reputation: 21 077

4

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.

ThePoShWolf

Posted 2016-08-19T21:49:30.360

Reputation: 171

1Take the False value using a simple constant: "$(!2)"[$?] (11 bytes) – krontogiannis – 2016-08-29T13:26:54.603

I posted this: [Convert]::ToString((8-3)*2,16) then scrolled through and was like daheck, does "$(!2)"[$?] actually work!? – Chad Baxter – 2016-10-07T00:39:56.437

4

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.

Emigna

Posted 2016-08-19T21:49:30.360

Reputation: 50 798

1Actually making use of that modulo: 833.@ – Martin Ender – 2016-08-21T12:57:55.533

@MartinEnder: Brilliant! – Emigna – 2016-08-21T17:41:41.133

4

Pure Bash, 23

r=({Y..b})
echo ${r[8]}

Creates this array and displays the 8th member:

Y Z [  ] ^ _ ` a b

Digital Trauma

Posted 2016-08-19T21:49:30.360

Reputation: 64 644

4

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

NinjaBearMonkey

Posted 2016-08-19T21:49:30.360

Reputation: 9 925

4

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

Joe

Posted 2016-08-19T21:49:30.360

Reputation: 895

4

VBA, 12 bytes

?Chr(88-23);

in the VBA Immediate window.

Joffan

Posted 2016-08-19T21:49:30.360

Reputation: 832

You could remove ; to make it 11 bytes – Anastasiya-Romanova 秀 – 2016-08-20T22:03:26.900

@Anastasiya-Romanova秀 ...except the instructions say to avoid a linefeed if you can. – Joffan – 2016-08-21T02:53:27.413

4

Dyalog APL, 12 bytes

⊃⎕DR/88-8 23

Equivalent to 80⎕DR65

ngn

Posted 2016-08-19T21:49:30.360

Reputation: 11 449

4

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.

Mark

Posted 2016-08-19T21:49:30.360

Reputation: 2 099

3

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, ClrHome is a single byte. Ans is 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.

Julian Lachniet

Posted 2016-08-19T21:49:30.360

Reputation: 3 216

3

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

Julian Knodt

Posted 2016-08-19T21:49:30.360

Reputation: 41

3

!@#$%^&*()_+, 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

Conor O'Brien

Posted 2016-08-19T21:49:30.360

Reputation: 36 228

3

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.

user85052

Posted 2016-08-19T21:49:30.360

Reputation:

3

International Phonetic Esoteric Language, 8 bytes (WIP language)

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

bigyihsuan

Posted 2016-08-19T21:49:30.360

Reputation: 1 483

3

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)

Conor O'Brien

Posted 2016-08-19T21:49:30.360

Reputation: 36 228

3

reticular, 9 bytes

"C"c2-co;

Try it online!

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

Conor O'Brien

Posted 2016-08-19T21:49:30.360

Reputation: 36 228

3

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

Karl Napf

Posted 2016-08-19T21:49:30.360

Reputation: 4 131

You could just use the same printf code as in your C solution inside the lambda and get rid of the argument to make it shorter. – Alexander Revo – 2016-08-20T21:20:05.497

3

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.

marinus

Posted 2016-08-19T21:49:30.360

Reputation: 30 224

3

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.

Business Cat

Posted 2016-08-19T21:49:30.360

Reputation: 8 927

Wow, exactly 1k ! Should I upvote? – NoOneIsHere – 2016-08-25T16:01:04.027

@NoOneIsHere: Go ahead, or I'll never get past it :) – Business Cat – 2016-08-25T16:15:36.040

3

Java 9 jshell, 18 bytes

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

jshell is a Java REPL that comes with Java 9.

David Conrad

Posted 2016-08-19T21:49:30.360

Reputation: 1 037

3

Mathematica, 27 25 bytes

Writes 10 in base 24. Half the length is one function name :(

IntegerString[2(8-3),3*8]

Thanks to Xavier for pointing out that the base doesn't have to be 16 (as in my original hexadecimal solution)!

Greg Martin

Posted 2016-08-19T21:49:30.360

Reputation: 13 940

What about First@WordList[]? – None – 2016-08-22T16:21:17.783

@Xavier: Make that an answer and I'll upvote it! – Greg Martin – 2016-08-22T17:52:01.330

Done! A small gain for your approach: IntegerString[8 + 2, 3*3 + 2] :-) – None – 2016-08-22T20:09:01.550

Unfortunately the mean OP doesn't let us use + in this challenge :) I upvoted your answer though! – Greg Martin – 2016-08-23T04:44:45.297

Ah yes, I have missed the + in the constraints. +1 as well! – None – 2016-08-23T12:47:30.617

But you did help me save 2 bytes :D – Greg Martin – 2016-08-23T16:10:46.237

Glad this was of help! :) – None – 2016-08-23T19:28:47.483

3

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

Leaky Nun

Posted 2016-08-19T21:49:30.360

Reputation: 45 011

3

SMBF, 4 bytes

<-.B

Try it Online!

Explanation:

<-    Wrap pointer around to the "B" and decrement it, giving "A"
  .   Print
   B  Data storage

Steven H.

Posted 2016-08-19T21:49:30.360

Reputation: 2 841

3

Pyke, 2 bytes

Gh

Try it here!

Gh - alphabet[0]

Blue

Posted 2016-08-19T21:49:30.360

Reputation: 26 661

3

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

Jonathan Allan

Posted 2016-08-19T21:49:30.360

Reputation: 67 804

188-23 saves one byte over 33*3-2 in the second example – SnoringFrog – 2016-08-23T14:29:00.973

1@SnoringFrog - how did I miss it?! Thanks! – Jonathan Allan – 2016-08-24T08:52:58.237

3

Bash, 19 17 bytes

Prints lower-case a:

printf \\$[282/2]

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

rici

Posted 2016-08-19T21:49:30.360

Reputation: 601

3

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

Stewie Griffin

Posted 2016-08-19T21:49:30.360

Reputation: 43 471

3

Fission, 5 bytes

R'B_O

Try it online!

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.

Dennis

Posted 2016-08-19T21:49:30.360

Reputation: 196 637

3

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.

Martin Ender

Posted 2016-08-19T21:49:30.360

Reputation: 184 808

3

PHP, 12 bytes

<?=chr(833);

Due to an overflow the above produces an 'A' (see example 2 of the PHP doc).

Kees

Posted 2016-08-19T21:49:30.360

Reputation: 41

3

Groovy, 12 bytes

print(--'B')

Makes use of the decrement operator overloading on Strings, per CharSequence.previous().

M. Justin

Posted 2016-08-19T21:49:30.360

Reputation: 151

3

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

JDL

Posted 2016-08-19T21:49:30.360

Reputation: 1 135

1I love how you did it. 297 = 3333 – Masclins – 2016-08-30T10:55:03.213

3

Bash, 14 bytes

tr P-R @-B<<<Q

Output:

A

seshoumara

Posted 2016-08-19T21:49:30.360

Reputation: 2 878

3

DC, 6 bytes

3BFFvP

...spits out an A and nothing else.

user19214

Posted 2016-08-19T21:49:30.360

Reputation:

3

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.

WallyWest

Posted 2016-08-19T21:49:30.360

Reputation: 6 949

3

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.

udioica

Posted 2016-08-19T21:49:30.360

Reputation: 2 381

3

Vim, 19 bytes (not competing)

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

Do you demand a shrubbery?

udioica

Posted 2016-08-19T21:49:30.360

Reputation: 2 381

3

Piet, 30 codels

I'm sure that this can be improved, but I'm a bit of a Piet newbie.

piet

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!

goose121

Posted 2016-08-19T21:49:30.360

Reputation: 151

Following community consensus on the meta, piet is now scored by the byte count of the image. You can try to compress it as much as possible provided there is a piet interpreter which accepts it. – Pavel – 2017-01-01T22:39:13.500

2

Japt, 3 bytes

Any of these 3-byte programs work:

;Bg
;Cg
;Hd

Test it online!

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

ETHproductions

Posted 2016-08-19T21:49:30.360

Reputation: 47 880

2

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.

peech

Posted 2016-08-19T21:49:30.360

Reputation: 309

I don't use Java but would 'C'-2 work and save you a byte? – Albert Renshaw – 2017-01-26T04:40:49.687

no, but [3-2] would :P thanks. Why it wouldnt work? Because .split("") splits a string by character and stores it into a string. something like ["j", "a", "v", "a", ".", "l", "a", "n", "g", ...]. with [3 - 2] I get the second string in that array, which is a. – peech – 2017-01-26T13:01:02.997

Interesting, thanks for the explanation! +1, clever solution – Albert Renshaw – 2017-01-26T19:49:29.053

2

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.

Engineer Toast

Posted 2016-08-19T21:49:30.360

Reputation: 5 769

2

Braingolf, 7 bytes

"C"2-@;

Try it online!

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*-@;

Try it online!

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-*@;

Try it online!

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-@;

Try it online!

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

Skidsdev

Posted 2016-08-19T21:49:30.360

Reputation: 9 656

:P - - - - - - - – totallyhuman – 2017-07-18T16:19:02.270

2

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

Try it online!

I've added the explanation of each step at the end of the step.

Teal pelican

Posted 2016-08-19T21:49:30.360

Reputation: 1 338

2

JavaScript (ES8), 12 bytes

`e${-{}}`[2]

This evaluates to:

"eNaN"[2]

which is "a".

user75200

Posted 2016-08-19T21:49:30.360

Reputation: 141

3Does this output or return from a function? If not, this is invalid. However, you can make this into a function by prepending _=> – caird coinheringaahing – 2017-11-12T21:26:14.617

1I am recommending deletion, as this answer appears to be invalid and there seems to be no effort put in fixing it. – Jonathan Frech – 2019-03-11T08:00:35.723

2

Pushy, 2 bytes

ZQ

Try it online!

Z          \ Push 0
 Q         \ Index into 0-indexed uppercase alphabet, print result

FlipTack

Posted 2016-08-19T21:49:30.360

Reputation: 13 242

2

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

Евгений Новиков

Posted 2016-08-19T21:49:30.360

Reputation: 987

2

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

J. Bergmann

Posted 2016-08-19T21:49:30.360

Reputation: 221

2

Pascal (FPC), 26 bytes

begin write(pred('B'))end.

Try it online!

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

AlexRacer

Posted 2016-08-19T21:49:30.360

Reputation: 979

2

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.

Try it online!

snail_

Posted 2016-08-19T21:49:30.360

Reputation: 1 982

2

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.

Kevin Cruijssen

Posted 2016-08-19T21:49:30.360

Reputation: 67 575

2

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.

Benjamin Urquhart

Posted 2016-08-19T21:49:30.360

Reputation: 1 262

34 – ASCII-only – 2019-03-11T07:03:38.097

9 – ASCII-only – 2019-03-11T07:11:04.860

@ASCII-only I thought that returned an integer. I guess golfing at night is not the best idea ;) Thanks. – Benjamin Urquhart – 2019-03-11T07:49:42.657

9 bytes excluding the semicolon btw – ASCII-only – 2019-03-11T08:19:18.580

@ASCII-only fixed, now time for sleep. – Benjamin Urquhart – 2019-03-11T08:20:31.693

2

Python 3, 18 bytes

print(str(int)[3])

Prints a lowercase a.

Explanation

Typing int into the interpreter gives <class 'int'>. The 4th character is an a, therefore we can convert it into a string and print the character at index 3.

Sagittarius

Posted 2016-08-19T21:49:30.360

Reputation: 169

2

MATL, 5 Bytes

'b'qc

Try it online!

James

Posted 2016-08-19T21:49:30.360

Reputation: 54 537

It's annoying that this requires the c, but unfortunately that behavior is a MATLAB/Octave thing. – Suever – 2016-08-19T22:20:47.863

2

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.

Οurous

Posted 2016-08-19T21:49:30.360

Reputation: 7 916

2

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

Try it online

Saved 3 bytes thanks to Joffan.

Emigna

Posted 2016-08-19T21:49:30.360

Reputation: 50 798

Is there a reason to involve R and B - why not iiisdsiP? – Joffan – 2016-08-21T03:21:35.717

@Joffan: You are of course correct. There's no reason at all to use R. Thanks! – Emigna – 2016-08-21T09:21:34.770

2

Pyth - 3 bytes

Alternate longer answer.

.HT

Try it online here.

Maltysen

Posted 2016-08-19T21:49:30.360

Reputation: 25 023

@ColdGolf accept the first one. – Maltysen – 2016-08-20T21:17:58.353

also mine is 3 bytes so it can't win. – Maltysen – 2016-08-20T21:18:05.330

2

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

Emigna

Posted 2016-08-19T21:49:30.360

Reputation: 50 798

2......You rang? – None – 2016-08-23T15:24:10.780

2

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.

David Conrad

Posted 2016-08-19T21:49:30.360

Reputation: 1 037

1You can replace print with $><< for -2 bytes. – Jordan – 2016-08-20T07:01:05.147

1(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. – manatwork – 2016-08-20T18:17:51.757

2

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.

tehtmi

Posted 2016-08-19T21:49:30.360

Reputation: 446

1_,_,z=type{}:find".(.)"print(z) 31 bytes – Egor Skriptunoff – 2016-08-27T13:24:06.760

2

Caker, 24 bytes

ωΩθΩθθθθθΩθΘ

Body must be at least 30 characters; you entered 29.

TuxCrafting

Posted 2016-08-19T21:49:30.360

Reputation: 4 547

2

Perl 6, 14 bytes

print 'B'.pred

pred is short for "predecessor"

Brad Gilbert b2gills

Posted 2016-08-19T21:49:30.360

Reputation: 12 713

2

WolframAlpha, 10 bytes

chr(88-23)

Anastasiya-Romanova 秀

Posted 2016-08-19T21:49:30.360

Reputation: 1 673

Do you mean "Wolfram Language"? – Buffer Over Read – 2016-08-21T03:30:50.330

@ColdGolf WA is a program using Wolfram language. It can also be called from Mathematica by typing equality sign twice (==). Check the link. – Anastasiya-Romanova 秀 – 2016-08-21T03:35:09.073

Are you implying I can't use WA? – Anastasiya-Romanova 秀 – 2016-08-21T03:38:19.723

Nope, it was just an interesting thing. – Buffer Over Read – 2016-08-21T03:42:18.697

2

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)

Crypto

Posted 2016-08-19T21:49:30.360

Reputation: 862

This is PHP 7 only, right? – manatwork – 2016-08-22T07:32:00.017

You're right PHP7 only, I'll edit – Crypto – 2016-08-22T09:37:12.743

2I can't fully test it since I don't have PHP7, but I think you can replace '' with some letter that is legal to use like b. If you do [].b it will concatenate Array with the string b giving Arrayb. – Business Cat – 2016-08-22T12:45:42.697

Thank you ! You're right. You can test it with any PHP online interpreter. (Errors and Warning can be ignored) – Crypto – 2016-08-23T05:36:21.580

2

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

Jeto

Posted 2016-08-19T21:49:30.360

Reputation: 1 601

2

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.

SnoringFrog

Posted 2016-08-19T21:49:30.360

Reputation: 1 709

2

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

Sweeper

Posted 2016-08-19T21:49:30.360

Reputation: 131

2

R, 12 bytes

I was losing it until I realized I can use 2 and 3.

 LETTERS[3-2]

Masclins

Posted 2016-08-19T21:49:30.360

Reputation: 914

2

Straw, 6 bytes (non-competing)

Bæ}Æ>

Take the codepoint of B (), get the tail of the string (unary decrement) (}), take the character associated with the codepoint (Æ), and print it (>)

Try it online

TuxCrafting

Posted 2016-08-19T21:49:30.360

Reputation: 4 547

2

QBasic, 17 bytes

PRINT CHR$(88-23)

Exploits the fact that the function which converts an integer to char is named CHR.

adrianmp

Posted 2016-08-19T21:49:30.360

Reputation: 1 592

2

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 a I see no way around this(not a golf language) It is possible...

Chad Baxter

Posted 2016-08-19T21:49:30.360

Reputation: 248

This is now fixed – Chad Baxter – 2016-10-08T17:47:04.657

1

GO, 22 20 bytes

print(string(88-23))

Try it online!

powelles

Posted 2016-08-19T21:49:30.360

Reputation: 1 277

1

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

12Me21

Posted 2016-08-19T21:49:30.360

Reputation: 6 110

It's scored in bvtes, not characters. – Buffer Over Read – 2017-01-24T13:10:48.147

Relying on user defaults might not be a good idea, but this is clever. – snail_ – 2017-01-24T16:26:35.510

Luckily all the function keys are reset when restarting SB, so this will always print A if it's the first thing you run. – 12Me21 – 2017-01-24T16:32:34.747

1

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

Albert Renshaw

Posted 2016-08-19T21:49:30.360

Reputation: 2 955

Suggest L"" instead of "%c",-'¿' – ceilingcat – 2019-03-11T03:48:13.000

1

,,,, 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             []

totallyhuman

Posted 2016-08-19T21:49:30.360

Reputation: 15 378

1

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.

ATaco

Posted 2016-08-19T21:49:30.360

Reputation: 7 898

1

Pyth, 3 2 bytes

-1 from Dave reminding me to actually read the docs

hG

Explanation:

hG      The first entry in G (the alphabet)

Try it online!

Stan Strum

Posted 2016-08-19T21:49:30.360

Reputation: 436

hG is one byte shorter – Dave – 2017-08-24T13:10:18.260

longer but cuter is Ch^^2 2 3 – Dave – 2017-08-24T13:14:02.157

@Dave Really? Didn't know that's how that worked – Stan Strum – 2017-08-24T16:07:24.580

h of a sequence returns the first value – Dave – 2017-08-24T16:11:22.737

You crossed out 3 and replaced it with 3 lol – Dave – 2017-08-24T16:15:55.970

1@Dave I should really head back to my desktop. This phone keyboard is so problematic. – Stan Strum – 2017-08-24T16:17:00.103

1

K (oK), 8 bytes

Solution:

`c$88-23

Try it online!

Explanation:

Interpretted right-to-left:

   88-23 / 88 minus 23 is 65
`c$      / cast to character ("A")

streetster

Posted 2016-08-19T21:49:30.360

Reputation: 3 635

1

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

Try it online!

FantaC

Posted 2016-08-19T21:49:30.360

Reputation: 1 425

1

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.

aaay aaay

Posted 2016-08-19T21:49:30.360

Reputation: 71

1

MathGolf, 3 2 bytes

-1 byte thanks to maxb

╩Z

Try it online!

Fetches the 90th word in the dictionary, which is a uppercase 'A'.

Jo King

Posted 2016-08-19T21:49:30.360

Reputation: 38 234

1

You can shave a byte off using ♂¢

– maxb – 2018-12-06T08:03:36.767

For lowercase you have ╩♦

– maxb – 2018-12-06T08:07:22.953

There's also ╩Z for the uppercase. Check out the MathGolf chat, I have a great tool coming up for challenges like this one.

– maxb – 2018-12-06T08:14:50.527

1

Ahead, 6 bytes

'C2-o@

'C      push 67 (C in unicode)
  2     push 2
   -    subtract
    o   print char
     @  end

Try it online!

snail_

Posted 2016-08-19T21:49:30.360

Reputation: 1 982

1

Scratch, 38 bytes

when gf clicked
think(letter(2)of<[]<[

Try it online!

think is used instead of say because say has an a.

W. K.

Posted 2016-08-19T21:49:30.360

Reputation: 51

1

MathGolf, 2 bytes

♂¢

Try it online.

Explanation:

♂     # Push 10
 ¢    # Convert to hexadecimal (and output implicitly)

Kevin Cruijssen

Posted 2016-08-19T21:49:30.360

Reputation: 67 575

1

Brian & Chuck, 7 bytes

B?
!<-.

Try it online!

code:

Brian:
B    constant B
?    switch to Chuck

Chuck:
<    go to B
-    decrement it
.    and print it

Dorian

Posted 2016-08-19T21:49:30.360

Reputation: 1 521

1

W d, 2 bytes

∑Ƿ

Explanation

Pretty much boils down to this after decompression:

'A

user85052

Posted 2016-08-19T21:49:30.360

Reputation:

1

Wren, 41 bytes

System.write(String.fromCodePoint(88-23))

Try it online!

user85052

Posted 2016-08-19T21:49:30.360

Reputation:

1You're not allowed to use characters 6 and 5 :/ – daniero – 2019-12-26T22:00:10.047

6 and 5 are disallowed because the asker knew someone would try this lol – Sagittarius – 2019-12-27T01:15:24.993

1

Pip, 4 bytes

/O@z

Try it online!

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.

DLosc

Posted 2016-08-19T21:49:30.360

Reputation: 21 213

1

Python - 20 bytes

print(chr(-~(8<<3)))

IPython 7.11.1 - 19 bytes

print(__doc__[3^3])

Hunaphu

Posted 2016-08-19T21:49:30.360

Reputation: 121

1Submissions must be full programs or functions, snippets are not allowed. You would need to print this somehow. – Stephen – 2020-01-24T15:06:07.647

1

Befunge 93, 7 bytes

"C"2-,@

Pretty simple.

Daniel

Posted 2016-08-19T21:49:30.360

Reputation: 6 425

1

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.

haykam

Posted 2016-08-19T21:49:30.360

Reputation: 784

console.log((3<2).toString().slice(3-2,2)) works too. – BartekChom – 2016-08-20T18:30:00.420

@BartekChom, thanks. Will update main post. – haykam – 2016-08-20T19:51:28.313

Why not console.log(String(!2)[~-2]) – Cyoce – 2016-08-21T06:59:02.520

1

Jellyfish, 5 bytes

P;>'@

Try it online!

ASCII-only

Posted 2016-08-19T21:49:30.360

Reputation: 4 687

1

Befunge-98, 6 bytes

'Lb-,q

Very basic: 'Lb- pushes (76-11 aka 65), , prints, q quits because using @ is too boring.

tngreene

Posted 2016-08-19T21:49:30.360

Reputation: 91

1

Ruby, 20 Bytes

print ("c".ord-2).chr

Subtracts 2 from the unicode-code from "c".

Mega Man

Posted 2016-08-19T21:49:30.360

Reputation: 1 379

1

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.

AquaGeneral

Posted 2016-08-19T21:49:30.360

Reputation: 13

I don't think this is valid, since it's just a snippet. It has to be wrapped in a function, which would almost definitely need to have an A or a U in it somewhere. – James – 2016-08-21T04:15:27.403

@DJMcMayhem I can't seem to see anything specifying that it must be wrapped in a function. I also noticed a few answers aren't even necessarily printing the result explicitly either.

It's also worth mentioning that by using something like C# Interactive (built into Visual Studio 2015, it's possible to just add the snippet I have above and it will output the correct value ('a'). Meaning if PowerShell can get away without a explicit print equivalent, C# could too? – AquaGeneral – 2016-08-21T07:00:02.160

I've asked about this here and have as such now specified that the solution is for C# Interactive (or any other REPL C# environment that might exist).

– AquaGeneral – 2016-08-21T07:48:35.923

1

Python 2, 16 bytes

print chr(88-23)

Simpler but longer (21 bytes):

print chr(ord('c')-2)

Nateowami

Posted 2016-08-19T21:49:30.360

Reputation: 131

1

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.

ClementNerma

Posted 2016-08-19T21:49:30.360

Reputation: 111

1

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)

Hedi

Posted 2016-08-19T21:49:30.360

Reputation: 1 857

1

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

n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳

Posted 2016-08-19T21:49:30.360

Reputation: 5 683

@TheBitByte: a is in the hex dump, not in the code. The code only contains character d and the control character 0x1A (decimal: 26) – n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ – 2017-02-02T20:54:48.270

1

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.

Scepheo

Posted 2016-08-19T21:49:30.360

Reputation: 466

Note the method to wrap the call could be an Action and be displayed as: ()=>System.Console.Write(...);, Note the System. and ending ;. – TheLethalCoder – 2016-08-22T10:06:08.140

The problem with that is that you can't declare an Action without an explicit cast. Which you can't do, because the 'A' in 'Action' is disallowed. – Scepheo – 2016-08-22T10:29:39.123

You don't need to declare the Action as the action by itself is fine i.e ()=>... – TheLethalCoder – 2016-08-22T10:33:33.007

Had a look and it does seem like anonymous lambdas are allowed. I've changed the answer accordingly. – Scepheo – 2016-08-22T10:59:59.087

1

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

joH1

Posted 2016-08-19T21:49:30.360

Reputation: 391

1

Javascript, 32 bytes

Uppercase A:

String.fromCodePoint(33*2-(3-2))

chronixlol

Posted 2016-08-19T21:49:30.360

Reputation: 19

“Your task is to print/display” – Your code is just a snippet generating the value. – manatwork – 2016-08-24T07:01:38.497

1

MSX-BASIC, 25 bytes

?CHR$(3*3*3*2-(-3-3-3-2))

Konamiman

Posted 2016-08-19T21:49:30.360

Reputation: 291

1

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.

  1. Enter the number 1 into index register 2 (assembler turns 2/2 into 1)
  2. Store the contents of index register 2 at memory address 8, later to be sent to the output device
  3. 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 a U.
  4. 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, change IN to OUT)
  5. Enter the number 19 into index register 2. The teletype output device is no. 19.
  6. Store the contents of index register 2 (=19) in the field-specification field (4:4) of the instruction at address 'P' (change 0 to 19 to specify the teletype device as output).
  7. 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.
  8. Stop the machine.

musarithmia

Posted 2016-08-19T21:49:30.360

Reputation: 531

1

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.

Timtech

Posted 2016-08-19T21:49:30.360

Reputation: 12 038

1

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

SuperJedi224

Posted 2016-08-19T21:49:30.360

Reputation: 11 342

1

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.

JustACluelessNewbie

Posted 2016-08-19T21:49:30.360

Reputation: 161

1

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.

dkudriavtsev

Posted 2016-08-19T21:49:30.360

Reputation: 5 781

does this display that character though? – Destructible Lemon – 2016-08-29T01:19:56.897

1

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]

asibahi

Posted 2016-08-19T21:49:30.360

Reputation: 371

1

Woefully, 400 bytes

| || |
|| |
||| |
|||| |
||||| |
|||||| |
||||||| |
|||||| |
||||| |
|||| |
||| |
|| |
| |
| |
| |
| |
| |
| |
|| |
|| |
|| |
|| |
|| |
|| |
||| |
||| |
||| |
||| |
||| |
|||| |
|||| |
|||| |
|||| |
|||| |
||| |
|| |
| |
|| |
|| |
|| |
||| |
|| |
| |
| |
| |
| |
|| |
|| |
|| |
||| |
||| |
||| |
||| |
|||| |
|||| |
||||| |
|||| |
||| |
|| |
| |
|| |
||| |
|| |
||| |
|||| |
||||| |
|||||| |
||||||| |

Can probably be golfed more

Destructible Lemon

Posted 2016-08-19T21:49:30.360

Reputation: 5 908

This language is cool, I've made my own version for this at 335 bytes - but not sure if I should answer such an old question with this language already used. – Teal pelican – 2017-07-18T14:58:19.350

@Tealpelican go for it! we don't care about necros (except when it's like a hundred tag adding necros, but that's irrelevant), and we don't care that much about reusing langs – Destructible Lemon – 2017-07-19T01:20:20.610

1

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]

Not that Charles

Posted 2016-08-19T21:49:30.360

Reputation: 1 905

1

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]

adrianmp

Posted 2016-08-19T21:49:30.360

Reputation: 1 592

1

Scala, 15 bytes

((2>3)+"")(3-2)

Explanation:

( 
  (2>3) //false
  +""   //toString
)(3-2)  //zero-indexed 1st char is 'a'

corvus_192

Posted 2016-08-19T21:49:30.360

Reputation: 1 889

1

k, 14 bytes

*|$`byte$38-28

This returns "a"

Paul Kerrigan

Posted 2016-08-19T21:49:30.360

Reputation: 189

What is this k language. Is it K? Where can I find out more about it? – Post Rock Garf Hunter – 2016-11-11T16:07:22.037

http://kparc.com/k.txt is the manual https://kx.com/ is the parent company's site - k in this case refers to k4, which is the c interpreter that underpins kdb+ and q. – Paul Kerrigan – 2016-11-11T17:03:47.830

0

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

mbomb007

Posted 2016-08-19T21:49:30.360

Reputation: 21 944

0

SmileBASIC, 12 bytes

Self-explanatory.

?CHR$(88-23)

snail_

Posted 2016-08-19T21:49:30.360

Reputation: 1 982

0

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.

dzaima

Posted 2016-08-19T21:49:30.360

Reputation: 19 048

0

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!

Renzo

Posted 2016-08-19T21:49:30.360

Reputation: 2 260

0

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

officialaimm

Posted 2016-08-19T21:49:30.360

Reputation: 2 739

0

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)

Taylor Scott

Posted 2016-08-19T21:49:30.360

Reputation: 6 709

0

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];

Francisco Hahn

Posted 2016-08-19T21:49:30.360

Reputation: 591

0

Pepe, 10 bytes

reeEEeeeeE

Try it online!

reeEEeeeeE pushes a to stack and outputs it.

u_ndefined

Posted 2016-08-19T21:49:30.360

Reputation: 1 253

0

Japt -g, 2 bytes

;B

Test it here

Shaggy

Posted 2016-08-19T21:49:30.360

Reputation: 24 623

0

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

Meerkat

Posted 2016-08-19T21:49:30.360

Reputation: 371

0

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.

cobaltp

Posted 2016-08-19T21:49:30.360

Reputation: 401

0

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.

Skidsdev

Posted 2016-08-19T21:49:30.360

Reputation: 9 656

0

J, 14 bytes

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

Try it online!

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

Jonah

Posted 2016-08-19T21:49:30.360

Reputation: 8 729

0

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

wooshinyobject

Posted 2016-08-19T21:49:30.360

Reputation: 171

0

AppleScript, 16

string id(88-23)

a stone arachnid

Posted 2016-08-19T21:49:30.360

Reputation: 1 053

0

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.

Esolanging Fruit

Posted 2016-08-19T21:49:30.360

Reputation: 13 542

0

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.

Draco18s no longer trusts SE

Posted 2016-08-19T21:49:30.360

Reputation: 3 053

0

Brain-Flak, 28 bytes

(((((()()()()){}){}){}){}())

Try it online!

code:

(((((()()()()){}){}){}){}()) push 65
                             implicitly print stack

Dorian

Posted 2016-08-19T21:49:30.360

Reputation: 1 521

0

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)

Lyxal

Posted 2016-08-19T21:49:30.360

Reputation: 5 253

0

Julia 1.0, 12 bytes

print('d'-3)

Try it online!

gggg

Posted 2016-08-19T21:49:30.360

Reputation: 1 715

0

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

Sagittarius

Posted 2016-08-19T21:49:30.360

Reputation: 169

So I assume this is a duplicate of another answer?

– None – 2019-12-25T04:13:38.007

@a'_' I'm not allowed to use 1 EDIT: just found a better solution – Sagittarius – 2019-12-27T01:02:04.737

0

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

Richard Crossley

Posted 2016-08-19T21:49:30.360

Reputation: 351

1PRINTCHAR has A inside. – None – 2019-12-26T04:18:40.990

It's PRINTCHR$, there is no A. I have a typo and have corrected it. – Richard Crossley – 2019-12-27T00:19:49.710

0

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.

Shieru Asakoto

Posted 2016-08-19T21:49:30.360

Reputation: 4 445

What might make this non-competing? – pppery – 2019-12-31T16:19:29.153

@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. – Shieru Asakoto – 2020-01-02T04:50:31.533

1That rules change does in fact apply to challenges that predate it. – pppery – 2020-01-02T12:33:44.290

0

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!

IMP1

Posted 2016-08-19T21:49:30.360

Reputation: 510

0

Brainfuck, 24 bytes

not as good as Dennis' anyones, but still posting it.

----[---->-<]>--[->-<]>.

Destructible Lemon

Posted 2016-08-19T21:49:30.360

Reputation: 5 908

0

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

SnoringFrog

Posted 2016-08-19T21:49:30.360

Reputation: 1 709

0

Perl6, 20

(?0).comb[3>2].print

bb94

Posted 2016-08-19T21:49:30.360

Reputation: 1 831

Also (88-23).chr.print (17 bytes, from the Ruby answer), but that's arguably degenerate. – bb94 – 2016-08-25T03:15:17.917

0

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

code1x1.de

Posted 2016-08-19T21:49:30.360

Reputation: 11

1. The downvote was cast automatically by the Community user when you edited your answer. I consider this a bug. 2. I'm not fluent in C++, but this looks like a snippet. Submissions have to be full programs or functions (named or lambdas) by default. – Dennis – 2016-08-28T19:52:36.123

0

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.

user47018

Posted 2016-08-19T21:49:30.360

Reputation:

0

Pyth, 6 bytes

C-*TT3

Try It Online

Explanation

C         ASCII integer to character
  -*TT3    (Ten*Ten)-3 (97)

Dignissimus - Spammy

Posted 2016-08-19T21:49:30.360

Reputation: 449

0

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.

Azor Ahai

Posted 2016-08-19T21:49:30.360

Reputation: 141

0

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

gabe3886

Posted 2016-08-19T21:49:30.360

Reputation: 221

turning off errors is not necessary: omitting the quotes will yield a notice; those are not printed with default settings. – Titus – 2016-11-11T14:30:45.610

0

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'

brendanjhowell

Posted 2016-08-19T21:49:30.360

Reputation: 1

-1

Python 3, 60 bytes

No disallowed characters

'%c'%-~((''=='')<<((''=='')-~(''==''))*((''=='')--(''=='')))

Try it online!

alexz02

Posted 2016-08-19T21:49:30.360

Reputation: 89

You should mark this as a REPL, since it doesn't actually output the letter. You can also shorten this severely by using digits, for example: '%c'%-~(-~3)**3

– Jo King – 2019-09-30T04:38:04.770