Programming Assignment 0

CS 4260/5260: Introduction to AI
Homework 0: (Racket Intro).

General Instructions:
If anything is ambiguous or unclear.
1. Discuss possible interpretations with other students, your TA, and instructor
2. Send e-mail to your TA first, and to your instructor if an issue is not resolved to your satisfaction.
3. Make use of web sources.
Remember that after general discussions with others, you are required to work out the problems by yourself. All submitted work must be your own, though you can get help with others, so long as you cite the help. Please refer to the class Honor code for clarifications.
Write legibly, be sure to staple all your answer sheets together, and write your
name, and the honor pledge on the top of the first answer sheet.
Start early, and avoid last minute stress!

Racket

For this course, we are going to use the programming language Racket. Racket is a functional programming language that builds on LISP and Scheme (if you are familiar with either of those languages you will notice a lot of similarities).

Racket is a good language for this class because it has great support for symbolic logic.

If you would like to read more about the Racket language, please go to https://racket-lang.org/

We recommend using its official IDE called DrRacket.

Installation

  1. Download is available through the quick tutorial site (http://docs.racket-lang.org/quick/index.html) and/or follow these instructionsGo to download address https://racket-lang.org/download/ and choose the windows binary execution installation file. Download and install.
  2. Debian / Ubuntu
    If you are using the apt-get package manager, type “sudo apt-get install racket” into the terminal
    Optionally
    If you want the latest version of Racket (not necessary for this course), you will need to add the official Racket source to your source list.
    – Add the Racket PPA: sudo add-apt-repository ppa:plt/racket
    – Install: sudo apt update && sudo apt install racket
  3. Other Linux Distributions
    Go to download address https://racket-lang.org/download/ and choose the linux binary execution installation file.
    Download and install.
  4. MacOS
    Using the binary
    Go to download address https://racket-lang.org/download/ and choose the MacOS binary execution installation file.
    Download and install.
    Using Homebrew Package Manager
    type “brew cask install racket” into the terminal

Instructions

Go through the tutorial at http://docs.racket-lang.org/quick/index.html.

For this assignment, submit a file called hw0_solution.rkt to Brightspace that draws a blue and yellow checkerboard on a canvas when run in Racket using the command (from the command line):

racket -t hw0_solution.rkt

Your file should make a pop-up that looks like the output below when run (with “My Name” replaced with your VUNet ID).

PA0image

This only needs small modifications from the code snippets in the tutorial. You are encouraged to experiment more to familiarize yourself with Racket.

Further Reading

For students who want a programming book to read, recommend How to Design Programs available for free at https://htdp.org/2003-09-26/Companion/drscheme.html. Students who want more examples but less reading should go through the tutorials at http://docs.racket-lang.org/continue/index.html and http://docs.racket-lang.org/more/index.html.