Table of contents

Carp programming language

%3 cluster_ffaa95a8_d758_44f3_a556_4d948190f963 Carp programming language _65bb06d6_5b1d_4203_8a45_088979ca2a9c Minimal example _d1499c8f_79dc_4c9f_9faa_d0717240504a Haskell _6d56a003_7d10_455e_84ed_5fc598fccd49 Lisp __0:cluster_ffaa95a8_d758_44f3_a556_4d948190f963->_d1499c8f_79dc_4c9f_9faa_d0717240504a __1:cluster_ffaa95a8_d758_44f3_a556_4d948190f963->_6d56a003_7d10_455e_84ed_5fc598fccd49

Minimal example

(load-and-use SDL)

     (defn tick [state]
       (+ state 10))

     (defn draw [app rend state]
       (bg rend &(rgb (/ @state 2) (/ @state 3) (/ @state 4))))

     (defn main []
       (let [app (SDLApp.create "The Minimalistic Color Generator" 400 300)
         state 0]
         (SDLApp.run-with-callbacks &app SDLApp.quit-on-esc tick draw state))2)