Skip to content

Instantly share code, notes, and snippets.

View NatashaTheRobot's full-sized avatar

Natasha Murashev NatashaTheRobot

View GitHub Profile
@NatashaTheRobot
NatashaTheRobot / CheckerboardKarel Solution
Created October 28, 2011 03:57
This is the solution to the CheckerboardKarel problem in the online Stanford CS 106A class
/*
* File: CheckerboardKarel.java
* ----------------------------
* When you finish writing it, the CheckerboardKarel class should draw
* a checkerboard using beepers, as described in Assignment 1. You
* should make sure that your program works for all of the sample
* worlds supplied in the starter folder.
*/
import stanford.karel.*;
@NatashaTheRobot
NatashaTheRobot / MidpointFindingKarel Solution
Created October 28, 2011 04:18
This is the solution the MidpointFindingKarel problem in the online Stanford CS 106A class
/*
* File: MidpointFindingKarel.java
* -------------------------------
* When you finish writing it, the MidpointFindingKarel class should
* leave a beeper on the corner closest to the center of 1st Street
* (or either of the two central corners if 1st Street has an even
* number of corners). Karel can put down additional beepers as it
* looks for the midpoint, but must pick them up again before it
* stops. The world may be of any size, but you are allowed to
* assume that it is at least as tall as it is wide.
@NatashaTheRobot
NatashaTheRobot / StoneMason Karel Solution
Created October 28, 2011 04:22
This is the solution to the StoneMasonKarel problem in the online Stanford CS 106A class
/*
* File: StoneMasonKarel.java
* --------------------------
* The StoneMasonKarel subclass as it appears here does nothing.
* When you finish writing it, it should solve the "repair the quad"
* problem from Assignment 1. In addition to editing the program,
* you should be sure to edit this comment so that it no longer
* indicates that the program does nothing.
*/
@NatashaTheRobot
NatashaTheRobot / CollectNewspaperKarel Solution
Created October 28, 2011 04:33
This is the solution to the CollectNewspaperKarel problem in the online Stanford CS 106A class
/*
* File: CollectNewspaperKarel.java
* --------------------------------
* At present, the CollectNewspaperKarel subclass does nothing.
* Your job in the assignment is to add the necessary code to
* instruct Karel to walk to the door of its house, pick up the
* newspaper (represented by a beeper, of course), and then return
* to its initial position in the upper left corner of the house.
*/
@NatashaTheRobot
NatashaTheRobot / KarelDefendsDemocracy
Created October 31, 2011 01:27
This is the solution to the Karel Defends Democracy Stanford 106A Section Problem
/* Karel is cleaning up the voting ballot.
* The vote only counts if the middle rectangle is punched,
* which means there are no beepers present.
*/
import stanford.karel.SuperKarel;
public class defendDemocracyKarel extends SuperKarel {
public void run() {
@NatashaTheRobot
NatashaTheRobot / Target
Created October 31, 2011 19:41
This is the solution to the Target problem from Assignment 2 of the Stanford CS106A Introduction to Programming Methodology Class
/*
* File: Target.java
* Name:
* Section Leader:
* -----------------
* This file is the starter file for the Target problem.
*/
import acm.graphics.*;
import acm.program.*;
@NatashaTheRobot
NatashaTheRobot / PyramidSolution
Created November 1, 2011 00:23
This is the solution to the Pyramid problem from Assignment 2 of the Stanford CS106A Introduction to Programming Methodology Class
/*
* File: Pyramid.java
* Name:
* Section Leader:
* ------------------
* This file is the starter file for the Pyramid problem.
* It includes definitions of the constants that match the
* sample run in the assignment, but you should make sure
* that changing these values causes the generated display
* to change accordingly.
@NatashaTheRobot
NatashaTheRobot / PythagoreanTheoremSolution
Created November 1, 2011 01:18
This is the solution to the Pythagorean Theorem problem from Assignment 2 of the Stanford CS106A Introduction to Programming Methodology Class
/*
* File: PythagoreanTheorem.java
* Name:
* Section Leader:
* -----------------------------
* This file is the starter file for the PythagoreanTheorem problem.
*/
import acm.program.*;
@NatashaTheRobot
NatashaTheRobot / ProgrammingHierarchySolution
Created November 1, 2011 05:35
This is the solution to the Programming Hierarchy problem from Assignment 2 of the Stanford CS106A Introduction to Programming Methodology Class
/*
* File: ProgramHierarchy.java
* Name:
* Section Leader:
* ---------------------------
* This file is the starter file for the ProgramHierarchy problem.
*/
import acm.graphics.*;
import acm.program.*;
@NatashaTheRobot
NatashaTheRobot / FindRangeSolution
Created November 2, 2011 00:19
This is the solution to the Find Range problem from Assignment 2 of the Stanford CS106A Introduction to Programming Methodology Class
/*
* File: FindRange.java
* Name:
* Section Leader:
* --------------------
* This file is the starter file for the FindRange problem.
*/
import acm.program.*;