Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<title>Penney Game</title>
<style>
canvas{ border: 1px solid black; }
</style>
</head>
<body>
public class TravelingSalesPerson
{
public TravelingSalesPerson()
{
String[] cities = {"Boston", "L.A.", "Las Vegas", "Atlanta", "Philadelphia", "Chicago", "Houston"};
public class Student
{
int age;
String name;
int gYear;
private int ss;
final int YEAR_FOUNDED = 1785;
@memish
memish / Upper.java
Last active February 26, 2018 15:42
public class Upper extends Student
{
public Upper(int g, String name)
{
super(g, name);
System.out.println("You are an Upper Schooler");
}
@memish
memish / Middle.java
Last active February 26, 2018 15:26
public class Middle extends Student
{
public Middle(int g, String name)
{
super(g,name);
System.out.println("You are a Middle Schooler");
}
import java.util.Scanner;
public class StudentStarter
{
public static void main (String [] args){
Student s;
Scanner sc=new Scanner(System.in);
int currYear = 2018;
/**
* A program to carry on conversations with a human user.
* This is the initial version that:
* <ul><li>
* Uses indexOf to find strings
* </li><li>
* Handles responding to simple words and phrases
* </li></ul>
* Tasks
* 1) handle response to good or bad moods
import java.util.Scanner;
/**
* A simple class to run the Magpie class.
* @author Laurie White
* @version April 2012
*/
public class MagpieRunner
{
speed(10);
count = 0;
h = new Turtle();
h.speed(1);
h.wear("dragon",20);
x = 0;
jumpto(250, 300);
while ((x < 4)) {
pen(orange, 10);
fd(20);
ArrayList<String> kicks = new ArrayList<String>;
kicks.add("35:L:X", "45:R:O","27:L:O","50:R:X","22:O:R");//sample values below
int rcount = 0;
int lcount = 0;
for(int i = 0; i<kicks.size(); i++){
int spot = kicks.get(i).indexOf(":");