Giter VIP home page Giter VIP logo

Comments (6)

davidchambers avatar davidchambers commented on June 19, 2024

The code as written in flow_control.md works for me:

(defn leap-year?
  "Every four years, except years divisible by 100, but yes for years divisible by 400."
  [year]
  (and (zero? (mod year 4))
       (or (zero? (mod year 400))
           (not (zero? (mod year 100))))))

(leap-year? 1900)  ; false
(leap-year? 2000)  ; true

What were you seeing?

from curriculum.

syves avatar syves commented on June 19, 2024

I switched lines 5 and 6 and then it worked, before it was returning true,
true

On Mon, Dec 22, 2014 at 1:55 PM, David Chambers [email protected]
wrote:

The code as written in flow_control.md
https://github.com/ClojureBridge/curriculum/blob/master/outline/flow_control.md
works for me:

(defn leap-year?
"Every four years, except years divisible by 100, but yes for years divisible by 400."
[year](and %28zero? %28mod year 4%29%29
%28or %28zero? %28mod year 400%29%29
%28not %28zero? %28mod year 100%29%29%29%29))

(leap-year? 1900) ; false
(leap-year? 2000) ; true

What were you seeing?


Reply to this email directly or view it on GitHub
#122 (comment)
.

from curriculum.

davidchambers avatar davidchambers commented on June 19, 2024

Could you try copying the snippet from my comment above and pasting it into the instarepl? Perhaps one of your parens was in the wrong place.

from curriculum.

syves avatar syves commented on June 19, 2024

that is weird it does work!

On Mon, Dec 22, 2014 at 2:10 PM, David Chambers [email protected]
wrote:

Could you try copying the snippet from my comment above and pasting it
into the instarepl? Perhaps one of your parens was in the wrong place.


Reply to this email directly or view it on GitHub
#122 (comment)
.

from curriculum.

syves avatar syves commented on June 19, 2024

maybe it was light table, sorry

On Mon, Dec 22, 2014 at 2:19 PM, Shakrah Yves [email protected] wrote:

that is weird it does work!

On Mon, Dec 22, 2014 at 2:10 PM, David Chambers [email protected]
wrote:

Could you try copying the snippet from my comment above and pasting it
into the instarepl? Perhaps one of your parens was in the wrong place.


Reply to this email directly or view it on GitHub
#122 (comment)
.

from curriculum.

davidchambers avatar davidchambers commented on June 19, 2024

No worries. :)

from curriculum.

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.