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 |
Imposes a restriction on the source code used to solve the challenge, for example, having no numbers in the source code.
1
vote
Determine if a number is divisible by 13 (without using 13 itself)
Python 2: 33 * 0.9 = 29.7 points
print['yes','no'][input()*2%26>0]
n*2%26 is equivalent to n%13. input()*2%26 will give a number from 0 to 12, and only numbers with 0 should print yes. To solve that, …
1
vote
yes is 91 lines long
Apparently this isn't totally portable. My sys.version is 2.7.9 (default, Dec 11 2014, 04:42:00) \n[GCC 4.9.2], so if yours is different this might not work I guess.
Python 2 - (76-10)=66
import s …
22
votes
yes is 91 lines long
Brainfuck - 38 bytes
++++++++++[>++++++++++++>+<<-]>+[.>.<]
It doesn't use 10 or 121, because +-<>.,[] are all the meaningful characters in the language anyway, but it does calculate them pretty na …
-1
votes
Hash collision: "NO" means "YES"
Here's a super lame one. SO LAME IT DOESN'T EVEN WORK
Python 2.7 - 79 bytes
def h(s):n=sum(100**i*ord(c)for i,c in enumerate(s));return (n-7978)*(n-836989)
First we get the sum of (each character' …
2
votes
Check if a UUID is valid without using regexes
Python 2, 99 112 bytes
def f(u):
try:u=u.split()[0];int(u.replace('-',''),16);print[8,4,4,4,12]==map(len,u.split('-'))
except:print 0
On a valid input, it prints True. On an invalid input it pr …
0
votes
Implement an integer parser
Python 2.7 - 102 bytes
def p(n):
a,r,l=0,range(10),list(n);d=dict(zip(map(str,r),r))
while l:a*=10;a+=d[l.pop(0)]
return a
I believe this is valid, but I'm not 100% sure about rule 3.
Creates a …
5
votes
Significant Whitespace
Python, 228 198 182 166 146 145 bytes
Counter (72 bytes):
ior1=0
w=lambda i:i.split()if ior1 else sum(ord(c)in(9,10,32)for c in i)
Splitter (73 bytes):
ior1=0
w=lambda i:i.split()if i or 1else s …