the problem isn't writing it, it's reverse engineering some physics from this game
I can see the appeal of an ice-skating FPS now that I think about it
@Riker next time you're playing a server with Sourcemod do sm_cvar sv_friction 0 (can't do it directly because it has FCVAR_DEVELOPMENTONLY in TF) and see how it goes
note to self: https://tio.run/##jVTBjtowED3jr3j1aluyIYFw6CHdbqVW/YMekVAEpus2sSPHkdivpzN2lg0siCIFz9hv3jyPx25f/LM1y8NBN611Hk4JYVt8hVzjDgUW@IISLRp8xDfMkEvRVP45AngpxQPmBHvEE01@QCYpXpO5CMBo2XZLYxFmoqW7kOWX6ynhxm4VM0q5EgXWoiTmNTG/feVofDjauUD4pSfoEtlZdBbR/H8x4jwXI6@hr2c9xo70lzfH/OJ@L@39fXz5XvcZV3nFftN7vu8re6Ya3qpd9t/Is4ib6GNtqUPEHfSnBn2nzW/qz1p5rxxa@mptVI7Gdh6VU/jTk9FRW9cKaQHrsF8K4VTX1z40mxA7mvT2L7Shvs@7ttZ@KlerLpUzcE8mpZhseudCD0@2ejC8e6GFid6Bu5jNVxR1PntG7X3wcm22aj@lHAnmcyx5MdLQjSBH1Z0ax4cbM2Jg/zpHuE1iovYb1XqmcZXuFL5XnfoZ5rQ1U/nDNk1ltrjvYKzHzvbkWMO@oxpK3IPJZ5CWqlhxkMSwN7BASE4kk4RKoGpfUeZp0JeBZSdEU…
Take an infinite hexagonal lattice (or equivalently, an equilateral triangular lattice), with unit spacing between the closest lattice point pairs, and draw a disc of radius $r$ centered on a lattice point at $(0, 0)$. Let $N(r, hex)$ denote the number of hexagonal lattice points at coordinates ...
@Pavel It's your fault to overflow int, not Javascript's...
Anonymous
n|0 is a common trick to coerce n to a 32-bit signed int. It's ridiculous that it's even required, though - IEEE-754 doubles should not be the default numeric type
@xnor I have a pretty good black magic proof, but I doubt it's simpler than yours (I also factor over the Eisenstein primes etc.)
@xnor I wrote up enough of it to convince me, but I should add some definitions of Eisenstein integers and stuff to round it out. I can send you a draft if you'd like!
Generally you would not want to do that for a bit larger array to avoid Stack Overflow. If you need hyperspeed and you're sure that stack size is large you can do that.
Is it an exercise set? code-golf decision-problem
An exercise part is a list of non-zero integers, where its second half consists of the integers of the first half negated and in the same order, and the signs of the integers on each half are equal. The sign of the first half of an exercise part ...
Is this a consecutive-prime/constant-exponent number?
code-golf number-theory
Sandbox:
Other tags?
Better title/name for the properties?
Anything unclear?
A while ago, I had a look at the prime factorization of 27000:
27000 = 23 × 33 × 53
There are two special things a...
@FrownyFrog ṖÐĿ pops the input until the result no longer changes, constructing all prefixes of the input. oṚ performs vectorizing logical OR of each prefix and the reversed input. Since characters are truthy, this pads the prefixes with the corresponding characters of the reversed input to the length of the input.
@wizzwizz4 poor fellow... now you're uneducated, with a corrupted file system and a broken package manager. Got backups? You can still borrow some wisdom from Windows and reinstall :)
@ASCII-only It has to do with the sign flips. You can see that xnor's code computes something like term1 - (term2 - (term3 - (... - 1))), so it's important that the base case is reached after an even amount of flips, or else it will contribute -1 to the sum instead of 1
@ASCII-only If you try n*n<a you'll see you get a bunch of off-by-two errors!
@ASCII-only xnor's n*n<a/3 works perfectly because a/3 only changes every other call. (a goes: 1, 2, 4, 5, 7, 8, 10, 11... so a/3 goes: 0, 0, 1, 1, 2, 2, 3, 3...)
Whitespace, 45 bytes
Try it online!
By the way, here is a proof that the ⌈n²/2⌉ formula is correct.
We can always place at least ⌈n²/2⌉ wazirs: just lay them out in a checkerboard pattern! Assuming the top-left tile is white, there are ⌈n²/2⌉ wh...
Mölkky
Mölkky is a Finnish throwing game. The players use a wooden pin (also called "mölkky") to try to knock over wooden pins of almost similar dimensions with the throwing pin, marked with numbers from 1 to 12. The initial position of the pins is as follows:
(07)(09)(08)
(05)(11)(12)(06)
...
@H.PWiz I'm planning to re-solve the first 100 from scratch in ngn/k :)
@H.PWiz that one has an interesting history: an Indian mathematician solved it a long time ago, was forgotten, then it took Europeans centuries to reinvent his method
@H.PWiz PE problems are generally designed to be solvable with 64-bit ints, except for a few that require simple bigint operations - they can be implemented using vectors of digits
/ for instance this is my add operation and solutions to 13, 16, and 25:
add:{n:1+|/#:'(x;y);(-~*|r)_r:{(10!x)+0,-1_x>9}/(x,&n-#x)+y,&n-#y}
. 10#|,/$add/|:'.:''0:"p013.txt" / 13
+/1000{add[x;x]}/,1 / 16
#{1000>#*|x}{x,,add/-2#x}/2#,,1 / 25
N * 100 rep for beating me at "Quine Suite" (Max 500)
The "Quine Suite" challenge is a challenge to write as many different quines as possible without sharing any characters between the quines. Currently, I have a record of 5, which just so happens to be the highest score on that thread (right n...