Introducing Karel

Jed Rembold

2025-08-25

Announcements

  • Welcome to CS-151: Intro to Programming with Python!
  • Things to do:
    • Access the course webpage at here!
      • There is also a link to the course webpage from the Canvas site
    • Read over the full syllabus
    • Join the class Discord server for ease of communication and announcements
    • Fill out the section availability form here
    • Bring phone or computer for polling questions in the future
    • Come to one of the laptop setup sessions Tuesday or Thursday at 3pm in Ford 202 or follow online guides and videos
  • Homework
    • Problem Set 0 will be posted by the end of the day, due by next Monday night

Introduction

My Vitals

Name
Jed Rembold
Office
Ford 214
Office Hours
M, W 1:00-2:00pm
T, Th 2:00-4:00pm
Online or anytime I’m around
Email:
jjrembold at willamette.edu
Office Phone:
503-370-6860

Motivations

  • The field of computing today is scarcely recognizable compared to the field 50 years ago.
  • Many feel the pace of the field is only accelerating as we move forwards.
  • Studying computing now lets you take part in driving forward not only the field of computing, but of all the modern fields with utilize computing.
    • Which is basically everything!

A Growth Mindset

  • People enter this course with a variety of initial experiences
    • This course is built for an individual entering with zero coding experience!
      • I’m endeavoring to break concepts down into as digestible chunks as possible
    • Coming in with more experience? You are welcome as well!
      • Help others! Nothing solidifies understanding like explaining to someone else.
      • Take advantage of the various extension opportunities and contests
      • Class/section time is not for impressing me or your section leader. Contribute to the learning environment.
  • Everyone can learn to program. It is all about growing in your understanding.

Succeeding in this course

  • Don’t go it alone!
    • Working with peers is invaluable. Create homework groups. Attend your small section meetings. Visit the QUAD center.
  • Budget your time carefully
    • The only way to grow at coding is to do coding
    • Programming can often times involve a lot of frustrating troubleshooting or unsuccessful attempts
    • Expect, on average, the full use of WU’s 2-3 hours outside class for every hour in class
  • If you are stuck for more than 30 minutes, ask myself or your section leader for help
    • While it is important to give yourself time to troubleshoot, past a certain point continuing to bang your head against a problem just leads to frustration

Squad Goals

To gain the skills, knowledge, and confidence necessary to write, test, and debug Python programs requiring several hundred lines of code.

Doing so will require that you be able to:

  • implement simple algorithms using Python control structures,
  • apply decomposition and step-wise refinement techniques,
  • design data structures to model information,
  • execute all phases of the programming process, including design, implementation, testing and debugging,

Class Components

Participation

  • Scored through participation in class polls or in contacting me with a question about a specific slide.
  • Generally 1-2 polls per day
  • Answering any poll gets you full points for the day (even if you are wrong!)
  • Answering correctly gets you bits of extra credit
  • Polling website at http://polling.jedrembold.prof
  • Will start officially on Wednesday

Practice

  • Falls into two categories:
    • Problem Sets: smaller, more focused assignments
      • Graded on standard, numeric scales
    • Projects: larger, more integrative assignments
      • Graded on a more qualitative scale (next slide)
  • All will be due on Mondays at 11:59pm
  • Submissions of both will be handled through GitHub Classroom
    • Learning how to do this in class
  • 3 cumulative late days over the entire semester without penalty then penalties enacted for each subsequent day late
  • Extensions for any reason need to be requested and approved by myself

Project Sneak Peeks!

Project Scoring

  A submission so good it leaves me astounded
Exceeds requirements
  Satisfies all assignment requirements
Meets most requirements, but some issues
  Some more serious problems evident
Even worse…
  Why even bother turning this in?

Sections

  • Everyone will be placed into small sections of 8-10 students, with one section leader
  • All section leaders are students who recently took and excelled in this course
  • Will meet as a group with your section leader once a week for an hour to go over and work on problems
    • These meetings will be on Wednesdays or Thursdays
    • Poll out today where you can enter in your availability on these days so that we can get people placed into sections
  • Section leaders will also serve as a secondary source you can ask for help or guidance from throughout the week
    • This tutoring is part of their job! Don’t hesitate to ask them for some extra assistance!
  • Planning to start section meetings next week

Tests

  • Tests are necessary to assure retention of material and ensure that some are not getting too much help on the assignments.
  • Three this semester:
    • Midterm 1 on October 4
    • Midterm 2 on November 8
    • Final on December 7
  • Tests will be taken in class and will not allow the use of a computer to actually run code
    • This policy has actually been seen to improve student scores, as it prevents you from wasting tons of time obsessing about a small mistake!
    • The computer can otherwise be used to access resources and submit responses
  • Tests will be open note, open book, and open slides, but not open internet
  • Several example tests and study materials will be given out a week in advance before each exam.

Communication

  • I have had strong success recently channeling class communication (announcements, questions, answers, etc.) through a class Discord server
    • Invite instructions will be announced on Canvas
    • Totally free to sign up and use
    • If you already use Discord, you can create another account to switch between, or you can use your existing account
  • Will be the main online location for announcements and questions and answers.
  • Has support for code-blocks when talking about code by surrounding code in triple backticks: ```this is formatted nicely as code```

Working Together and Academic Honesty

  • You are always welcome and encouraged to work alongside others enroute to finding a solution to a problem. But, your submitted work needs to be your own.
  • The most effective way to accomplish this is to:
    1. Not look at solutions or program code that is not your own.
    2. Not share your solution code with other students.
    3. Indicate on your submitted assignment any assistance you received or who you worked alongside.

Generative AI

  • You are free in this class to use things like ChatGPT or GitHub Copilot to assist you in writing, understanding, or troubleshooting code
  • However:
    • LLMs make mistakes, and you need to understand the code to be able to catch them.
    • You will not be able to use these tools on the tests, so ensure that you can do without.
  • Assignments will have a field at the top where you can provide a link to the chat transcript if you used one. If you used an AI that doesn’t provide a transcript, state as much.

My favorite AI

What is Programming?

Diving In

  • This course is an introduction on computer science, and covers more than just programming!
  • Python is used to teach the programming portion of the course, but the focus is less on Python itself and more on general computer science principles.
  • If you come across situations where you need to know a bit more about specific Python details, there are plenty of resources online, or just ask me!

Effective Communication

  • To communicate effectively with someone or something, you really need two layers of communication:
    • A shared language or method of conveying information
      • The English alphabet, for example
      • In our case, Python
    • A joint agreement about what constitutes meaning
      • Need ways to limit confusion or misunderstanding
        • Following syntax
        • Following conventions
      • Being able to explain things clearly and unambiguously

Giving Clear Instructions

  • We will initially make the language extremely simple so that we can focus on the second layer
  • Karel the Robot exists in a very simple 2D world
  • Has a very limited set of actions:
    • Can move forward one space
    • Can rotate counter-clockwise (turn left) 90 degrees
    • Can pick up a beeper
    • Can drop off a beeper
  • We will be spending the first several class days just interested in how we can take these simple instructions and get Karel to solve a wide variety of problems
    • This content is not in your text, but more in-depth descriptions can be found here

The World

  • Karel’s world is defined on a grid
    • avenues run north-south
    • streets run east-west
    • The intersection between a street and avenue is called a corner
  • Compass directions are as you’d have them on a map, with North pointing upwards
  • Walls are impassable
  • Beepers are diamonds
  • Karel is a house-shaped polygon

Commands

  • As we mentioned before, Karel is a simple robot, and can really only do 4 potential actions

    Command Action
    move() Moves Karel forward one intersection in whatever direction they are facing
    turn_left() Rotates Karel 90 deg counter-clockwise
    pick_beeper() Picks up a beeper on the ground
    put_beeper() Places a beeper on the ground
  • Our programs are just ordered sequences of these actions/commands

Example

  • Suppose we had the situation to the right and wanted to navigate to the beeper, pick it up, and then drop it at the corner of 1st avenue and 1st street.
  • Take a moment to write out your instructions.
    • Remember you can only move, rotate left, and pick up or drop the beeper
  • Note that there are multiple ways to do this! Which is better?

One Solution

def main():
    move()
    turn_left()
    turn_left()
    turn_left()
    move()
    turn_left()
    move()
    turn_left()
    turn_left()
    turn_left()
    move()
    pick_beeper()
    turn_left()
    turn_left()
    turn_left()
    move()
    move()
    put_beeper()