Code Monkey home page Code Monkey logo

Comments (5)

gre avatar gre commented on September 19, 2024

This means that currentSample cannot be 9 (after --currentSample)

var kSplineTableSize = 11;
var currentSample = 1;
var lastSample = kSplineTableSize - 1;

for (; currentSample !== lastSample; ++currentSample) {
}
--currentSample;

console.log(currentSample)

=> 9

from bezier-easing.

Validark avatar Validark commented on September 19, 2024

Oh, now that I think about it, that only means that the loop cannot increase intervalStart to 1, and doesn't affect currentSample in that way. My bad.

from bezier-easing.

Validark avatar Validark commented on September 19, 2024

It only runs for [1, 9] but still increases currentSample from 1 to 10 even if it doesn't run on 10

from bezier-easing.

gre avatar gre commented on September 19, 2024

yes ;) that code might deserve rewriting because is not so readable.

from bezier-easing.

Validark avatar Validark commented on September 19, 2024

Meh, I should have caught that. I for some reason thought that the check statement would keep the iterator from incrementing one last time. I ran a test in C++ real quick on my computer and it ran [1, 9] which seemed to validate my claim, but I didn't print to console what the iterator was right after the for loop because I assumed it would just be the last value. I thought about it in the wrong order.

from bezier-easing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.