Skip to main content
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
Results tagged with
Search options not deleted user 10636

Code-golf is a competition to solve a particular problem in the fewest bytes of source code.

2 votes

Golf String's format() inverse

Ruby, 312 characters class String def-@ self[0,1].tap{self[0,1]=''}end end def format1 f,s,r=[] loop{if'{'==c=-f n,f=f.split('}',2) [*1..s.length,0].each{|i|next if'{'!=f[0]&&s[i]!=f[0] if u=format1( …
Nathan Baum's user avatar
3 votes

Test a number for narcissism

Haskell 2010 - 76 characters main=do x<-getLine;print$(==x)$show$sum$map((^length x).(+(-48)).fromEnum)x
Nathan Baum's user avatar