Haskell rocks

I have done sooooo much with our programming teacher Chris I have learned how to program Haskell in the smallest definition.

I am running a program that looks like this on the raw end of it  (not a functional code)

import Graphics.Gloss

    cloud=pictures [translate (-5) (32) color (light(light rose)) (circleSolid 85)),
    translate (-160) (32)color (light(light rose)) (circleSolid 85)) ,
    translate (156) (32 color (light(light rose)) (circleSolid 85)),
    color (light (light (light yellow)) (rectangleSolid 480 100)]

    beam=pictures[color orange rectangleSolid 3 100)]

{-   sun=pictures [(color orange (circleSolid 99)),
      translate -96 -32 (beam),
    rotate (-90) (translate (134) (-200) beam),
    rotate (-90) (translate (134 50) beam),
    rotate (-45) (translate (70 -36 beam),
    rotate (45) (translate -165 80 beam)]

picture = pictures [color ( dark rose) (rectangleSolid 500 500),
    translate -98 -150 (color orange (circleSolid 99)),

    translate -96 -32 (beam),

    rotate (-90) (translate 134 -200 beam),
rotate (-90) (translate 134 50 beam),
    rotate (-45) (translate 70 -36 beam),
    rotate (45) (translate -165 80 beam),
     rotate 50 (translate -163 -275 (color(dark(dark green)) (circleSolid 99)),
    (translate -180 -280 (color(dark(dark green)) (circleSolid 99)),
    (translate -65 -300 (color(dark(dark green)) (circleSolid 99)),
    (translate 190 -290 (color(dark(dark green)) (circleSolid 99)),
    translate 100 100(scale (0.5) (0.5) (cloud)),
    translate 50 -245) ((scale (0.25) (0.25)) (text Sunset by: Marcello))]
wich looks like this

PhotobucketIt was fun finding errors with the code and fixing the and putting in the ray (in code beams) I swear they took about 45min a piece.

I cant wait untill next class :)

 

by marcello

 

 



3 Responses to “Haskell rocks”

  1.   daniel Says:

    Congrats! Keep it up!

  2.   Dustin Says:

    Very cool! With time it gets easier and less time consuming. Hope you’re finding it fun!

    Learning to program is surely an opportunity you wouldn’t have had in a traditional school. How fortunate you are!

  3.   Simon Says:

    Cool!

Trackbacks/Pingbacks

  1. Haskell for Kids: Week 2! « Sententia cdsmithus

Leave a Reply