===== Homework assignments ===== === Note on the private test data === A part of any programming assignment is generating test cases and testing the produced algorithm. It is a very important skill each programmer has to master, regardless of the programming paradigm. Please, take the result of the automatic evaluation as a hint that you should continue this process. Do not ask for the private test data and do not ask what is wrong with your output in the evaluation system. In the real world, no one will give you even this feedback and if you release a product with serious mistakes, you will suffer losses in money and reputation. A more realistic evaluation of your work would be to run the automated evaluation only once, after the deadline, to score your submissions. On the other hand, if you spend a long time (at least 4 hours) without any progress and you have created a decent set of your own test cases that pass without any problems. I encourage you to write to your lab teachers to help you design additional test cases or possibly help identify the mistakes in your code. For writing your test cases, you can use the unit testing framework provided by racket. To write unit tests, it suffices to import the rackunit module into your code. Then it is possible to test your functions by the function ''check-equal?'' comparing the expected output with the actual output. Consult also your local documentation in DrRacket to get more details on rackunit. #lang scheme (module+ test (require rackunit)) (define (only-numbers lst) (filter number? lst)) (module+ test (check-equal? (only-numbers '(1 a 2 3)) '(1 2) "You made an error!")) ===== Scheme ===== ==== Homework assignment 1 ==== Submit your solution as a zip archive containing a single file with the name **hw1.rkt**. The description of the assignment can be found [[https://drive.google.com/file/d/1cyfLDtlBvXgthCQU4mM6I3pmUi8ZnNOl/view?usp=sharing|here]]. /* To fulfill your wish from the lecture, I provide an extra test case for the first homework assignment with Arnold Schwarzenegger. The input image is {{https://drive.google.com/file/d/11lT2PHHRaa_DKIEl0VOylh0T9VQ1o5E1/view?usp=sharing|here}}. The output for the block size 8x16 and ''chars=" .,:;ox%#@"'' is {{https://drive.google.com/file/d/1hZUSwl__bxdBsJrbFtTBtPeyepZlnhzK/view?usp=sharing|here}}. */ ==== Homework assignment 2 ==== Submit your solution as a zip archive containing a single file with the name **hw2.rkt**. Using the built-in function ''eval'' is not allowed! The description of the assignment can be found [[https://drive.google.com/file/d/14AYzN33HGmkpd7WAjRIsxp2fOjO0MTWw/view?usp=sharing|here]]. ===== Haskell ===== ==== Homework assignment 3 ==== Submit your solution as a zip archive containing a single file with the name **Hw3.hs**. The description of the assignment can be found [[https://drive.google.com/file/d/1-x2TErUU72n1LGimIjq4qMta9MSL373o/view?usp=sharing|here]]. ==== Homework assignment 4 ==== Submit your solution as a zip archive containing a single file with the name **Hw4.hs**. The description of the assignment can be found [[https://drive.google.com/file/d/1rXAKtlkkRFhzfrKPY0LkbYQIXG6LApuM/view?usp=sharing|here]]. The module ''Parser.hs'' can be downloaded [[https://drive.google.com/file/d/1zVbVpSl0UphPmglpGa94P0TQI3OVMPAL/view?usp=sharing|here]]. /* Submit your solution as a zip archive containing a single file with an arbitrary name and *.ss extension. The submitted code must work with R5RS standard. Instruction "#lang" is not a part of the standard. The code should be submitted without it. [[https://cw.felk.cvut.cz/courses/a4b33flp/task.php?task=simulator|Assignment 1]] To solve Assignment 1 you can get an inspiration from this {{ :courses:fup:homework:calc_defs.ss.txt | code}}. It implements a calculator evaluating an algebraic expressions which might contain variables whose values are defined by an algebraic expression. [[http://cw.felk.cvut.cz/courses/a4b33flp/task.php?task=population_evaluator|Assignment 2]] Note that you should extend the result of your first assignment in your second assignment. If you did not manage to make it work perfectly, you can continue using the upload system to verify the first part. Just write me to give you your points back once you are finished. If you do not manage to debug your solution anyway, write me an email and ask for a reference solution for the first assignment. [[http://cw.felk.cvut.cz/courses/a4b33flp/task.php?task=automatic_code_synthesis|Assignemnt 3]] [[http://www.macs.hw.ac.uk/~ml355/common/thesis/c6.html|Genetic Programming Intro]] [[https://cw.felk.cvut.cz/brute/|Submission system]] */ /* ==== Haskell ==== Must work with Hugs. [[courses:fup:homework:haskell1|Assignment 4]] [[courses:fup:homework:haskell2|Assignment 5]] [[https://cw.felk.cvut.cz/brute/|Submission system]] */