Timeline for Empty a Swimming Pool . . . With Only a Red Solo Cup
Current License: CC BY-SA 3.0
36 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 16, 2015 at 4:35 | history | edited | Downgoat | CC BY-SA 3.0 |
deleted 3 characters in body
|
Aug 12, 2015 at 6:11 | history | rollback | Downgoat |
Rollback to Revision 13
|
|
Aug 12, 2015 at 6:11 | comment | added | Downgoat | @edc65 really? I've rolled the edit back and I'll debug it in the morning. I've been testing with the examples in the questions. | |
Aug 12, 2015 at 6:10 | history | rollback | Downgoat |
Rollback to Revision 14
|
|
Aug 12, 2015 at 5:43 | comment | added | edc65 | Starting again at doing wrong... I give up. | |
Aug 12, 2015 at 2:15 | comment | added | ETHproductions |
@vihan Bummer. Well, if you changed -~(f(a)/f(z)*d) to -~(f(a)/f(z))*d , would the output be perfectly legal? I'm still not an expert on the order of operations, so I don't know if this would actually work...
|
|
Aug 12, 2015 at 1:06 | comment | added | Downgoat | @ETHproductions No unfortunately, property shorthands must be enclosed because they are considered an "expression", therefore needing parenthesis | |
Aug 12, 2015 at 1:04 | history | edited | Downgoat | CC BY-SA 3.0 |
added 59 characters in body
|
Aug 12, 2015 at 0:56 | comment | added | ETHproductions |
Impressive! Could you get rid of the parentheses in f=([a,g,k,p]) , or would that mess something up?
|
|
Aug 12, 2015 at 0:49 | history | edited | Downgoat | CC BY-SA 3.0 |
added 57 characters in body
|
Aug 11, 2015 at 21:40 | history | edited | Downgoat | CC BY-SA 3.0 |
added 3 characters in body
|
Aug 11, 2015 at 21:31 | history | edited | Downgoat | CC BY-SA 3.0 |
added -~! shorthand
|
Aug 11, 2015 at 20:31 | history | edited | Downgoat | CC BY-SA 3.0 |
deleted 2 characters in body
|
Aug 11, 2015 at 20:23 | history | edited | Downgoat | CC BY-SA 3.0 |
added 67 characters in body
|
Aug 11, 2015 at 18:57 | comment | added | jrich |
Also, this could likely be shortened by testing for string length to determine what shape it is. For example, a[6] ? a[8] ? /* rectangle */ : /* triangle */ : /* circle */ } See my answer for an example of this. I think this could shave off another two (a score of 77!), but haven't tested for sure yet.
|
|
Aug 11, 2015 at 18:45 | comment | added | jrich |
Looks good, +1. You can save 2 bytes by changing a<'r'?3.14*g*g*k:g*k*p/(a<'t'?1:2)) into g*k*(a<'r'?3.14*g:p/(a<'t'?1:2))) , which will reduce it to 79 bytes!
|
|
Aug 11, 2015 at 17:24 | comment | added | Downgoat |
@edc65 I think this should work now. -~ had issues with the decimal numbers and would result in rounding up an extra step. I've had to add a<'t'?1:2 because (1+(a>'t')) doesn't work for some reason.
|
|
Aug 11, 2015 at 17:22 | history | undeleted | Downgoat | ||
Aug 11, 2015 at 17:19 | history | deleted | Downgoat | via Vote | |
Aug 11, 2015 at 17:17 | history | undeleted | Downgoat | ||
Aug 11, 2015 at 17:17 | history | edited | Downgoat | CC BY-SA 3.0 |
added 1 character in body
|
Aug 11, 2015 at 17:11 | history | edited | Downgoat | CC BY-SA 3.0 |
added 1 character in body
|
Aug 11, 2015 at 17:04 | history | deleted | Downgoat | via Vote | |
Aug 11, 2015 at 16:56 | comment | added | edc65 |
Have a look at my solution, I can't post it because it's way too similar to yours... f=(p,c,s,v=([s,a,b,c])=>s<'r'?a*a*b*3.14:a*b*c/(s<'t'?1:2))=>Math.ceil(v(p)/v(c))*s
|
|
Aug 11, 2015 at 16:53 | comment | added | jrich |
@vihan What happens if the pool volume is an exact multiple of the cup volume, like in t(["triangle", [10, 12.25, 3]], ["triangle", [10, 12.25, 3]], 5) ? I get 10 but shouldn't the answer be 5 ? EDIT: just beaten by edc65, same problem.
|
|
Aug 11, 2015 at 15:33 | history | edited | Downgoat | CC BY-SA 3.0 |
fixed rounding issue
|
Aug 11, 2015 at 15:21 | history | edited | Downgoat | CC BY-SA 3.0 |
Fixed rectangle/ triangle issue
|
Aug 11, 2015 at 5:24 | history | edited | Downgoat | CC BY-SA 3.0 |
deleted 49 characters in body
|
Aug 11, 2015 at 5:13 | history | edited | Downgoat | CC BY-SA 3.0 |
deleted 2 characters in body
|
Aug 11, 2015 at 4:59 | comment | added | Downgoat | @AlexA. oh yeah... completely forgot about that | |
Aug 11, 2015 at 4:59 | history | edited | Downgoat | CC BY-SA 3.0 |
added 1 character in body
|
Aug 11, 2015 at 4:57 | comment | added | Alex A. |
Rather than .5*v , couldn't you do v/2 ?
|
|
Aug 11, 2015 at 4:56 | history | edited | Downgoat | CC BY-SA 3.0 |
added 1 character in body
|
Aug 11, 2015 at 4:50 | history | edited | Downgoat | CC BY-SA 3.0 |
deleted 5 characters in body
|
Aug 11, 2015 at 4:44 | history | edited | Downgoat | CC BY-SA 3.0 |
added 8 characters in body
|
Aug 11, 2015 at 4:38 | history | answered | Downgoat | CC BY-SA 3.0 |