Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wb =. 'white',:'black'
- dist =. [: %: +/@:*:@+.@(-&50j50)
- clamp =. ((o. 2)&+)^:(<&0)
- angle =. [: clamp (o. 0.5) - 12 o. (-&50j50)
- solve =. inradius`('white'"_)@.(dist@] > 50"_)
- inradius =. otherwise`(wb {~ 0 < [)@.((50 = [ *. 50 <: ])/@+.@])
- otherwise =. wb {~ (angle % o.@2:)@] <: %&100@[
- join =. ([,LF,])/
- NB. Drop head because we don't need the number of cases
- cases =. >@}.@(-.&a:)@(e.&(CR,LF) <@".;._2 ])
- format =. [: , ,&': '@('Case #'&,)@":"0@>:@i.@# ,. (,&LF)"1
- in =. 1!:1 <'progress_pie.txt'
- out =. format ({. solve j./@}.)"1 cases in
- out 1!:2 <'progress_pie_out.txt'
- exit''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement