Assignment 1

And the assignment 1 in clojure is here finally :), it has been quite hard to convert it.
I have rewritten the heap without doing any change in the design to make the same questions that are in the scala's assigment.
Actually the properties have to be done as functions. 
The properties function are in the file quick_check_properties.clj

As said the assignment instructions you have to write a good number of properties check to make all test pass.
If you launch "lein test" in the directory of git you will see there are 5 test that fail.
They will pass when you will write the properties that check the fault in the 5 bogus implementation.
I'll post the solution after the hard date, in this way I'll not not give any hint.
The Heap implementations are made with protocols, actually I think it his quite a bad implementation, probably made for educational purpouse, if I have time I'll make a better implementation with multi methods.
Let me know what do you think, I'm new also to clojure, so I'll appreciate any tip/hint you can gave me :)
For any question feel free to comment I'll reply as soon as possible.
Again, the repository is here https://github.com/marcomanzi/reactiveclojure, you will find the quick_check_properties.clj where you have to write the functions to solve the assignment.


NB: I'm working on it, there are some problems but I'll fix it soon!! :)....
02:33--> Assignment is ready, you can solve it :), have fun

Comments

  1. Thanks Marco
    I'm doing the Scala course myself, but my heart is in Clojure :)
    Looking forward for your solution!

    ReplyDelete
    Replies
    1. I have already solved it in Clojure, it has been easier for me.
      Unfortunately clojurecheck is not advanced as ScalaCheck and I have given to methods called for tests only a integer generated. Each method is called n time with a different integer each time.
      To solve the assignment I have implemented a HeapGenerator like the assignment suggest, but It's a little easier to use it in Scala, because it is given as parameter in input once you have implemented it. Instead in Clojure you have to call it but it's not a bit problem :)
      Only a little point for ScalaCheck that is better implemented for this kind of assignment i think.

      Delete

Post a Comment