New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step branch #1

Merged
merged 261 commits into from Jul 21, 2016
Commits
Jump to file or symbol
Failed to load files and symbols.
+18 −18
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Merge two loops together, pretty cool optim! :)

  • Loading branch information...
pvdz committed Feb 22, 2016
commit 55f46bbaf37385fc976648198d40010841ee53f0
Copy path View file
@@ -230,23 +230,6 @@ <h1>
fitty = M2/9;
pixels = [];
Z=0;
for (i = K*K; i--;) pixels.push({
// pixel values are initialized to a number, the actual number isnt super relevant so we use that to save one byte per other var initializers
x: 0, // atomvx = speed of atom
y: 0, // atomvy = speed of atom
A: 0,
B: 0, // F= friction. lower means faster pixels.,
// default position unless special
X: FLOOR(i%K * M/K),
Y: FLOOR(i/K * M/K), // i*M/(K*K)
// n
// q
// u
});
(function R() {
// pretty sure this can be reduced to `data=x&&y`, TBD
@@ -283,7 +266,24 @@ <h1>
atomy += atomvy *= atomy<0|atomy>M ? -1 : 1;
for (i=K*K; i--;) {
p = pixels[i];
p = pixels[i] = pixels[i] || {
// pixel values are initialized to a number, the actual number isnt super relevant so we use that to save one byte per other var initializers
x: 0,
y: 0,
A: 0,
B: 0,
// default position unless special
X: FLOOR(i%K * M/K),
Y: FLOOR(i/K * M/K), // i*M/(K*K)
// N
// Q
// U
};
if (data) {
// if data[x+0], the space is occupied by a letter. set p.U so the pixel joins the moving "atom".
p.U = data[t=(p.X + p.Y * M) * 4] ? i : 0;
ProTip! Use n and p to navigate between commits in a pull request.