Exercises
The goal of these exercises is to make you acquainted with high-level concepts present in the programming language Pico. We will discuss operators, recursion, functions returning functions, functions as arguments for other functions, functional parameters, table generation, higher-order functions on tables, functions with a variable amount of arguments and function application trough the @-operator.
There are multiple exercises on the use and the syntax of each specific programming concept, of which we will solve a selection. The remainder of the exercises are meant to be solved individually in case you encountered any difficulties during the class.
Do not hesitate to contact me when you're stuck on a problem: Coen De Roover
Installing sPico
For these exercises, we rely on the sPico variant of the Pico programming language which comes packaged as a plugin for the PLT DrScheme programming environment.
Instructions
Download PLT DrScheme version 360 (make sure you don't download any other version!) for either Windows or Mac OS X.
Install DrScheme. Windows users have to start the installer by double clicking the downloaded file. Macintosh users drag the folder "PLT Scheme v360" to their "Applications" folder.
Windows users download [spico2007-0607.progprincipes.00-win32-i386-360.plt], while Macintosh users have to choose between [sPico Installer PPC] for PPC or [sPico Installer i386] for Intel Macs.
Install the file you downloaded in the previous step. Windows users double click the file. Macintosh users have to drag the file to the folder "PLT Scheme v360" in their "Applications" folder before double clicking.
Launch DrScheme. Windows users will find DrScheme in the Start menu, while Macintosh users will find DrScheme in the "PLT Scheme v360" folder.
Select the option "Choose Language" from the "Language" menu.
Select "Pico 2007" and press OK.
-
As soon as you have pressed the "Run" button in the DrScheme toolbar, "spico2007 (v0607.progprincipes.00)" will appear in the bottom pane. This is where you can evaluate Pico expressions.