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 answers only user 34531

For challenges pertaining to problems in the field of Physics.

2
votes
Haskell, 69 bytes r=replicate f n=[0..n]>>= \a->r a '\n'++r(n-a)' '++'O':r(2*a)' '++"O" Usage example: f 3 -> " OO\n O O\n\n O O\n\n\nO O". Try it online!.
answered Mar 3 '17 by nimi
1
vote
Haskell, 145 bytes import Control.Concurrent a!b=[a..b]>>"\n" f h=mapM(\k->putStr("\27[2J"++1!k++'O':k!h++"-")>>threadDelay(round$4472135*(sqrt(k+1)-sqrt k)))[1..h] Needs to be run in an ANSI term …
answered Feb 9 by nimi
4
votes
Haskell, 116 96 82 76 bytes f x=signum$sum$zipWith(*)[-length(fst$span(<'^')x)..]$(`mod`16).fromEnum<$>x Output is 0 for balanced, -1 for left-heavy and 1 for right-heavy. Usage example: f "321^ …
answered Nov 24 '15 by nimi
4
votes
Haskell, 149 144 bytes z=zip[0..] g n|f<-[(x,y,c)|(y,r)<-z$lines n,(x,c)<-z r,c>' ']=sum[c%d/sqrt((x-i)^2+(y-j)^2)|a@(x,y,c)<-f,b@(i,j,d)<-f,a/=b]/2 c%d|c==d=1|1<2= -1 Usage example: *Main> g " - …
answered Dec 29 '15 by nimi
4
votes
Haskell, 650 bytes Task 1, 88 bytes: f n="x "++unlines(map(take 4.(++" ").show=<<)$[1..n]:map(\a->a:map(a*)[1..n])[1..n]) Task 2, 76 bytes: g s=sqrt(sum(map(fromIntegral.(^2).fromEnum)s)/sum( …
answered Nov 6 '15 by nimi