Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Code-golf is a competition to solve a particular problem in the fewest bytes of source code.
2
votes
I'm walking around manhattan, how far am I from my hotel?
Java, 185, 203, 204, 217, 226
class A{public static void main(String[] a){int x=0,y=0;for(int i=0;i<a[0].length();i++) switch(a[0].charAt(i)){case'U':y++;break;case'D':y--;break;case'L':x++;break;cas …
2
votes
2
answers
269
views
ROT13 and upside-down text (flip text)
When I saw this title in the Hot Network Questions I thought it was going to be a PPCG challenge. I was a little disappointed when it was on Mathematica.
So now it is on PPCG:
Challenge
Given an in …
1
vote
Shortest method to implement the Pythagorean Theorem
Java, 112
(Also prints out a No Such Method error, though I'm not sure if this is against the rules)
class A{static{int a=1,b=1;System.out.printf("The hypotenuse of this right triangle is %.3f",Math …
17
votes
21
answers
1k
views
Generate a 6 character string from a 15 character alphabet
In one of our projects at work, we recently discovered a particularly large method for generating a 6 character string from a 15 character alphabet. A few of us claimed "I bet we can get that in one l …
4
votes
Stop, stand there where you are!
PHP, 39 bytes
function a($a){while($i++<.4583e8*$a);}
(Note that I can actually get this shorter if a full program is required by taking advantage of arguments passed on command line. Down to 35) …
16
votes
Print all 2 letter Scrabble Words
PHP 224, 218, 210 206
foreach(explode(",","I19SR,9ZY8H,,CNK,5JRU0,H,CN4,G0H,H160,CN4,75,CU9,AMIHD,MTQP,HQOXK,7L,74,G,CXS,CU9,HTOG,,CNK,MHA8,CNL,1")as$a){$b++;for($c=0;$c<26;$c++)echo base_convert($a, …
25
votes
18
answers
3k
views
Chemistry 101 - Introduction to the Periodic Table
Question
Given the atomic number of an element in the range [1-118] output the group and period, of that element as given by the following Periodic Table Of Elements.
For elements in the Lanthanide an …