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
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
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
Results tagged with Search options user 34543

Code-golf is a competition to solve a particular problem in the fewest bytes of source code. If you want to score by characters instead of bytes, please state this explicitly in the challenge. If source code length is not the primary scoring criterion, consider using another tag instead.

2
votes
Brainfuck, 71 bytes +[--------->+<]>+.>,+[[-]>[->+<]+>[<->-]<<,+]>[<<+>>-]<+++[<------>-]<. Assumes that EOF = -1. Explaination: The first part, +[--------->+<]>+., prints : and stores its ascii …
answered May 1 '16 by Loovjo
0
votes
Vim, 13 bytes qqaa<esc>"Ax@qq@q This defines a macro, q that appends the letter a to the register A and then calls itself. This results in an infinite loop of making register A bigger and bigger, o …
answered Feb 15 '17 by Loovjo
2
votes
Retina, 21 18 14 bytes (..)+ :( \(. ) 3 bytes saved thanks to Martin Büttner. Another 4 saved thanks to Kenny Lau. Try it online! (The first line is just to make it run for all test cases). Uses …
answered May 1 '16 by Loovjo
3
votes
Python, 393 bytes def z(n,h=[]): for j in range(len(n)):h.append(sum(cmp(ord(n[i]),ord(n[i+1]))for i in range(j))) h=[j-min(h)for j in h] for y in range(max(h)*2+2): s="" for x in range(len(n) …
answered Aug 29 '15 by Loovjo
0
votes
Golfscript, 35 bytes {."aeiouåäö\n "?-1={."o"\}{}if}% Expects the input to be on the stack. With input (50 bytes): "#{STDIN.gets}"{."aeiouåäö\n "?-1={."o"\}{}if}% Works with the swedish vovels å …
answered Mar 25 '15 by Loovjo
5
votes
JavaScript, 49 bytes a=>a.map(n=>" ".repeat(a.length-n.length)+n) Takes the arguments as a list of strings and also returns a list of strings. Explanation: a=> …
answered Oct 18 '16 by Loovjo
14
votes
4answers
What general tips do you have for golfing in LOLCODE? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to LOLCODE. (e.g. "remove comments" …
asked May 9 '15 by Loovjo
5
votes
Java, 428 bytes void s(String s){int l=s.length(),m=0;char[][]c=new char[l][];for(int i=0;i<c.length;java.util.Arrays.fill(c[i++],' '))c[i]=new char[l];String v="aeiouyAEIOUY";String[]a=s.split(" "); …
answered Jul 1 '15 by Loovjo
3
votes
Python 2, 129 bytes def T(t,a):f=[int.__add__,int.__sub__]["-"in a];m=f(int(t[3:5]),int(a[7:9]));print`f(int(t[0:2])+m/60,int(a[4:6]))%24`+":"+`m%60` Call as T("02:45", "UTC-05:33")
answered Sep 11 '16 by Loovjo
20
votes
8answers
Say I have a list such as [3, 0, 4, 2, 1], and I use selection sort to sort it, I could visualize it like this: 3,0,4,2,1 |-| 0,3,4,2,1 |-----| 0,1,4,2,3 |-| 0,1,2,4,3 |-| 0,1,2,3,4 Thi …
asked Oct 9 '16 by Loovjo
18
votes
2answers
In this challenge you will write a program that takes two newline-separated strings, s1 (the first line) and s2 (the second line), as input (STDIN or closest). You can assume that the length of s1 wil …
asked Jun 7 '15 by Loovjo
2
votes
Python 3, 178 bytes from math import* p,n=[3,5],int(input()) while len(p)<n: for i in range(p[-1],p[-1]**2): v=sqrt(i**2+p[-1]**2) if v==int(v)and gcd(i,p[-1])==1: p+=[int(v)];break print(p) …
answered Oct 28 '16 by Loovjo
4
votes
Python 2.7.6, 99 bytes def c(t):n=hash(t)%3;return" ___\n/"+" ^."[n]+" "+" ."[n]+"\\\n|"+[" ","^ ^"," . "][n]+"|\n\\___/" This algorithm relies on the fact that hash(cookie)%3 gives 0 when cookie …
answered Aug 4 '15 by Loovjo
4
votes
Python 2, 6967 6965 6950 6906 bytes Q=[["USA",1,2],["Canada",0],["Mexico",0,4,3],["Guatemala",2,4,5,6],["Belize",2,3],["El Salvador",3,6],["Honduras",3,5,7],["Nicaragua",6,8],["San Jose",7,9],["Panam …
answered Feb 27 '16 by Loovjo
1
vote
Java, 565 chars D: public class M{public static void main(String[]r){int[]p=new int[36];int u=0;for(;;){String l=new java.util.Scanner(System.in).nextLine();if(l == "q")break;int a=l.charAt(0)-'0'+ …
answered May 16 '15 by Loovjo

15 30 50 per page