CSE 113 - Spring 2010 - Banner
UB -
University at Buffalo, The State University of New York Computer Science and Engineering
  • CSE 113 - Spring 2010
CSE 113 - Spring 2010 - Navigation
CSE 113 - Spring 2010 - Announcements

Lab 1

CSE 113 - Spring 2010 - Announcements

Week 1 (1/18 - 1/23)

Before Coming to Lab

Due to a problem getting accounts set up, we are asking that all students visit the following link (http://www.sens.buffalo.edu/accounts/) at least one day prior to your first recitation session. All you need to do at this page is enter your UBIT name and click the Request Account button. The process usually processes your account overnight, but sometimes can take up to 24 hours, so please try to visit this page as soon as possible before your recitation. If you do not have an account this first week, you should be sure to give your name to the TAs. You will still be able to complete the lab in the time given over the next two weeks.

In Lab - Login

Make sure you can log onto the computers in Bell 340. After you log in, make sure you know how to log out. Make sure that you do not leave your computer logged in while you are not using it.

If you have a problem logging in, make sure to talk to the TA in your recitation section so that they can make note of your UBIT name and ensure that your account is working for next week.

If you can log in, continue on to the following. After you have completed the next section, you are free to leave and continue the rest of the assignment next week in recitation.

 

Open Greenfoot

First, you must open a terminal window so that you get a prompt and you can type commands directly to the operating system (i.e. your machine).

Here are two ways to bring up a terminal:

  1. Right click on an empty space on your desktop and select "Open Terminal" from the menu.
  2. Click on the "Accessories" menu, then click on "Terminal".

You will see a terminal window will look like this (the words you see may be different, but you will get a prompt ">"):
Terminal window

Now follow these steps:

  • At the prompt, type
    ssh -X machineName

where you substitute the machine's name for machineName. The names of the machines are on sticky labels right on the machine.

The first time you do this (on a particular computer), you will be asked if you want to accept the SSH key - type the word "yes" (without the quotes) and hit enter. The message about this will be quite lengthy, but the bottom line is that you want to say "yes".

The message will look something like this:

terminal with error message

Note that after typing "yes", you will be prompted to log in with your password again. After you enter your password and hit Enter, you will get the prompt back. Note that at this point when you enter your password, it will look like nothing is happening. The cursor will not move, but your password is being accepted.

Then, you will get your prompt back and can type:

        greenfoot & 

You will see the splash screen and then Greenfoot will start up.

At this point, you don't need to do anything and can simply close the Greenfoot program. If you choose to continue work on this lab, you can simply start Greenfoot again.

The procedure for starting Greenfoot is the same in both Bell 340 and Bell 101. If you have installed the program on your own machine, there will be a shortcut to it somewhere that you simply need to select to start the program.

Copy a scenario into your account

Before we copy anything into your account, we should set up a space for you to store your CSE 113 work. Open the file explorer for your home directory (icon on the desktop called So-and-so's home, where so-and-so is your UBIT name) and select to create a new folder in your account (either using right-click or select File->Create Folder from the menus at the top. Name this folder CSE 113. You will put all of your work for CSE 113 in this folder.

Greenfoot operates using scenarios. Scenarios give us a base to work with when programming in Greenfoot. Throughout the semester, you will need to make sure that a copy of the scenario is in your own personal account before you begin working on the lab assignment. We will have you copy over the first scenario now. Open up the file explorer for the entire system by clicking on the icon on the desktop named Computer. Click on the Filesystem icon. Navigate to /eng/class/notes/cse113.

In this directory, you will see a directory named book-scenarios, and inside that will be directories for all the chapters of the book. Find the directory for chapter01 and inside there you will find a directory named leaves-and-wombats, which contains all the files for leaves and wombats scenario from chapter 1. Select this directory and elect to "copy" it. Now, open the file explorer for your home directory and inside the directory you just created for CSE 113, "paste" the leaves and wombats scenario directory.

We will be working with this scenario to get practice moving, zipping, and submitting files. You will need to copy a different scenario to work on the rest of the assignment.

If you are working from home, you can get the leaves-and-wombats scenario from here.

 

Zip up a scenario

Before you submit an assignment, you will need to zip up the contents of the scenario directory. Let's practice zipping at this time.

In the file explorer, right click and select to archive the directory containing the leaves-and-wombats scenario by selecting "Create Archive" from the right-click menu. Leave the name of the Archive to be the same as the name of the directory. To the right of the name is a drop-down for what type of archive you would like to create. You should choose .zip from the drop down of possible archive choices.

After you have completed the zipping procedure, you should see the zip file in your directory as well as the scenario directory itself.


Weeks 2 and 3 (1/25 - 2/5)

Little-Crab Scenario

For the remainder of this assignment, you will work with the little-crab scenario that is discussed in Chapters 2-4 of the text. You will complete various exercises with the scenario and during the week of February 8th, you will be demonstrating your proficiency with these tasks in an in-recitation assessment.

The first step is for you to get the scenario and copy it to your own account. If you are in Bell 340, then you should simply navigate over to /eng/class/notes/cse113/book-scenarios/chapter02-04 and copy the little-crab directory to your account. If you are working at home, you can copy the little-crab.zip file from the link. You will need to put it in your CSE 113 space on your home machine and you will need to unzip it.

After you have the scenario, you should open Greenfoot and open the scenario. You should complete the exercises from Chapters 2 & 3 in the text. You should pay special attention to the following exercises. Some of the exercises ask you to do something with the scenario and then change it back. Some ask you to think about the results of doing something. You should do each of the exercises, whether or not it makes a noticeable change in the code. These exercises are designed to get you used to doing things with Greenfoot and to get you thinking about programming. In the end, you will have changed the program in many ways and will have a somewhat interesting game.

2.1 3.3 3.9 3.17
2.2 3.4 3.10 3.18
2.3 3.5 3.12  
2.4 3.7 3.13 3.19
2.6 Insert the code for shown in figure 3.3 on page 34 & 35 3.15 3.22
2.12 3.8 3.16 3.24

 


Working outside of Bell 340

If you would like to continue this work outside of Bell 340, there are a few options available to you. You can work in Bell 101, which is an engineering public computing site. Information about the differences you may encounter when in Bell 101 are located here.

If you want to work on your own machine, totally independent of the lab environment, you will need several things. This page will explain where to look for information about downloading the files and programs you need to work on your home machine.

It is most advisable for you to create a folder (directory) on your machine where you can put the files needed for your assignments. This way, all work for this course will be in the same place when you go to look for it.


In-recitation Assessment

Your ability to complete the tasks of this lab assignment will be assessed through an in-recitation assessment held during your scheduled recitation time the week of February 8th. A schedule of when students should report for the assessment is available here. During the in-recitation assessment, you will be ask to perform tasks similar to those required of you during the lab assignment. It is therefore a good idea to make sure that you complete the assigned exercises and truly understand each of the required tasks so that you will perform well on the assessment.


Lab authored by Adrienne Decker

CSE 113 - Spring 2010 - Footer

Page maintained by Adrienne Decker

Contact: adrienne@buffalo.edu | 130 Bell Hall | (716)645-3184