The Bot Bikeshed
-
@error_bot eval let radius = 50 ; def withinRadius(x,y) => pow(pow(x,2)+pow(y,2),.5) < radius ; def split(r) => (r > radius) ? (r - radius) : (0 - r) ; let sample = 6 * radius ; def descend(n,s) => n > 0 ? descend( n - 1 , s + ( withinRadius( split(1d100) , split(1d100) ) ? 1 : 0 ) ) : s ; def trial() => descend(sample, 0) / ( sample / 4 ) ; trial() ; trial()
-
3.013trial() (3.013) = 3.0133.093trial() (3.093) = 3.093
-
@error_bot eval let radius = 50 ; def withinRadius(x,y) => pow(pow(x,2)+pow(y,2),.5) < radius ; def split(r) => (r > radius) ? (r - radius) : (0 - r) ; let sample = 4 * radius ; def descend(n,s) => n > 0 ? descend( n - 1 , s + ( withinRadius( split(1d(2 * radius)) , split(1d(2 * radius)) ) ? 1 : 0 ) ) : s ; def trial() => descend(sample, 0) / ( sample / 4 ) ; trial() ; trial()
-
Error: Unknown function: d
-
@error_bot eval let radius = 50 ; def withinRadius(x,y) => pow(pow(x,2)+pow(y,2),.5) < radius ; def split(r) => (r > radius) ? (r - radius) : (0 - r) ; let sample = 4 * radius ; def descend(n,s) => n > 0 ? descend( n - 1 , s + ( withinRadius( split(1d100) , split(1d100) ) ? 1 : 0 ) ) : s ; def trial() => descend(sample, 0) / ( sample / 4 ) ; trial() ; trial() ; trial()
-
3.02trial() (3.02) = 3.022.96trial() (2.96) = 2.963.1trial() (3.1) = 3.1
-
@error_bot eval let radius = 50 ; def withinRadius(x,y) => pow(pow(x,2)+pow(y,2),.5) < radius ; def split(r) => (r > radius) ? (r - radius) : (0 - r) ; let sample = 2 * radius ; def descend(n,s) => n > 0 ? descend( n - 1 , s + ( withinRadius( split(1d100) , split(1d100) ) ? 1 : 0 ) ) : s ; def trial() => descend(sample, 0) / ( sample / 4 ) ; trial() ; trial() ; trial() ; trial() ; trial() ; trial()
-
3.28trial() (3.28) = 3.283.24trial() (3.24) = 3.243.12trial() (3.12) = 3.123.28trial() (3.28) = 3.282.96trial() (2.96) = 2.963.08trial() (3.08) = 3.08
-
@error_bot eval let radius = 50 ; def withinRadius(x,y) => pow(pow(x,2)+pow(y,2),.5) < radius ; def split(r) => (r > radius) ? (r - radius) : (0 - r) ; let sample = 2 * radius ; def descend(n,s) => n > 0 ? descend( n - 1 , s + ( withinRadius( split(1d100) , split(1d100) ) ? 1 : 0 ) ) : s ; def trial() => descend(sample, 0) / ( sample / 4 ) ; ( trial() + trial() + trial() + trial() + trial() + trial() ) / 6
-
3.093(trial() (3.44) + trial() (3) (6.44) + trial() (2.68) (9.12) + trial() (3.16) (12.28) + trial() (3.16) (15.44) + trial() (3.12) (18.56)) / 6 (3.093) = 3.093
-
@error_bot said in The Bot Bikeshed:
3.093(trial() (3.44) + trial() (3) (6.44) + trial() (2.68) (9.12) + trial() (3.16) (12.28) + trial() (3.16) (15.44) + trial() (3.12) (18.56)) / 6 (3.093) = 3.093meh, a little better. Maybe if I take a worse estimate...
-
@error_bot eval let radius = 50 ; def withinRadius(x,y) => pow(pow(x,2)+pow(y,2),.5) < radius ; def split(r) => (r > radius) ? (r - radius) : (0 - r) ; let sample = radius ; def descend(n,s) => n > 0 ? descend( n - 1 , s + ( withinRadius( split(1d100) , split(1d100) ) ? 1 : 0 ) ) : s ; def trial() => descend(sample, 0) / ( sample / 4 ) ; ( trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() ) / 12
-
3.133(trial() (3.12) + trial() (3.28) (6.4) + trial() (3.04) (9.44) + trial() (3.36) (12.8) + trial() (2.96) (15.76) + trial() (3.12) (18.88) + trial() (3.12) (22) + trial() (3.44) (25.44) + trial() (3.12) (28.56) + trial() (3.28) (31.84) + trial() (2.64) (34.48) + trial() (3.12) (37.6)) / 12 (3.133) = 3.133
-
This post is deleted!
-
@error_bot eval let radius = 50 ; def withinRadius(x,y) => pow(pow(x,2)+pow(y,2),.5) < radius ; def split(r) => (r > radius) ? (r - radius) : (0 - r) ; let sample = radius ; def descend(n,s) => n > 0 ? descend( n - 1 , s + ( withinRadius( split(1d100) , split(1d100) ) ? 1 : 0 ) ) : s ; def trial() => descend(sample, 0) / ( sample / 4 ) ; ( trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() ) / 13
-
3.145(trial() (3.12) + trial() (3.2) (6.32) + trial() (3.2) (9.52) + trial() (3.28) (12.8) + trial() (3.44) (16.24) + trial() (3.12) (19.36) + trial() (2.96) (22.32) + trial() (3.36) (25.68) + trial() (3.44) (29.12) + trial() (2.88) (32) + trial() (3.2) (35.2) + trial() (2.88) (38.08) + trial() (2.8) (40.88)) / 13 (3.145) = 3.145
-
@error_bot eval let radius = 50 ; def withinRadius(x,y) => pow(pow(x,2)+pow(y,2),.5) < radius ; def split(r) => (r > radius) ? (r - radius) : (0 - r) ; let sample = radius ; def descend(n,s) => n > 0 ? descend( n - 1 , s + ( withinRadius( split(1d100) , split(1d100) ) ? 1 : 0 ) ) : s ; def trial() => descend(sample, 0) / ( sample / 4 ) ; ( trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() ) / 17
-
Error: ttl expired
-
@error_bot eval let radius = 50 ; def withinRadius(x,y) => pow(pow(x,2)+pow(y,2),.5) < radius ; def split(r) => (r > radius) ? (r - radius) : (0 - r) ; let sample = radius ; def descend(n,s) => n > 0 ? descend( n - 1 , s + ( withinRadius( split(1d100) , split(1d100) ) ? 1 : 0 ) ) : s ; def trial() => descend(sample, 0) / ( sample / 4 ) ; ( trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() + trial() ) / 13
-
3.046(trial() (3.12) + trial() (3.2) (6.32) + trial() (2.72) (9.04) + trial() (2.88) (11.92) + trial() (2.96) (14.88) + trial() (3.2) (18.08) + trial() (3.2) (21.28) + trial() (3.04) (24.32) + trial() (3.04) (27.36) + trial() (2.96) (30.32) + trial() (2.96) (33.28) + trial() (3.04) (36.32) + trial() (3.28) (39.6)) / 13 (3.046) = 3.046
-
@error_bot secret I'm getting the impression this isn't the most efficient or reliable way to approximate pi
-
New builtin functions:
gcd
greatest common divisor, variadichypot
pythagorean theorem, variadiclcm
lowest common multiplemedian
variadicnegative
x < 0positive
x > 0prime
x is primerandomInt
min inclusive max exclusiveroot
nth rootstddev
variadicvariance
variadic
-
Reroll modifier now allows
!
.@error_bot roll 4d20R!prime
-
544d20R! prime (7,20,14, 17,20,12, 17,20,15, 13: 54) = 54
-
@error_bot said in The Bot Bikeshed:
4,0962 ^ 3 (8) ^ 4 (4,096) = 4,096Bad associativity. 2^3^4 should be 2^(3^4) = 2^(81) ≈ 10^24
-
@PleegWat Yeah I actually noticed that operator should be right-to-left, but then I thought, "who's raising powers to powers in a dice module?"
Silly me.
-
@PleegWat said in The Bot Bikeshed:
@error_bot said in The Bot Bikeshed:
4,0962 ^ 3 (8) ^ 4 (4,096) = 4,096Bad associativity. 2^3^4 should be 2^(3^4) = 2^(81) ≈ 10^24
@error_bot eval 2*2^3^4/2
-
2,417,851,639,229,258,300,000,0002 * 2 ^ 3 ^ 4 (81) (2,417,851,639,229,258,300,000,000) (4,835,703,278,458,517,000,000,000) / 2 (2,417,851,639,229,258,300,000,000) = 2,417,851,639,229,258,300,000,000
-
Funny, I imported a math library just for
isPrime
(I could implement it but inefficiently), and the damn thing has a fully prefab string expression parser built in.
-
eval "def r(x)=>d2==1?x:r(x+1); r(0); r(0); r(0); r(0); r(0)"
-
@error_bot
@error said in The Bot Bikeshed:
eval "def r(x)=>d2==1?x:r(x+1); r(0); r(0); r(0); r(0); r(0)"
-
0r(0) (0) = 01r(0) (1) = 11r(0) (1) = 13r(0) (3) = 30r(0) (0) = 0
-
-
@error said in The Bot Bikeshed:
Funny, I imported a math library just for
isPrime
(I could implement it but inefficiently), and the damn thing has a fully prefab string expression parser built in.And this is why a good coder never uses NIH code. Why risk your boss figuring out you're just cashing a paycheck?
-
Fixed the parsing issue with the less-than operator. You shouldn't need the "lt" workaround any more.