Skip to content

Instantly share code, notes, and snippets.

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import java.awt.Dimension;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.event.MouseListener;
String words = "apple bear cat dog";
String[] list = split(words, ' ');
// Writes the strings to a file, each on a separate line
saveStrings("nouns.txt", list);
BufferedReader reader;
String line;
void setup() {
// Open the file from the createWriter() example
reader = createReader("positions.txt");
}
void draw() {
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import java.awt.Dimension;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.event.MouseListener;
public class TwoDArray
{
public static void main(String args[])
{
// int[][] sales = new int[4][6];//row column
//OR
//q1, q2,q3,q4
int[][] sales = { {2,3,4,5},//2014
{7,8,19,10},//2015
import processing.video.*;
Capture cam;
Capture cam2;
int count=0;
PImage myImg=null;
PImage myImg2=null;
void setup() {
public class TwoDArray
{
public static void main(String args[])
{
// int[][] sales = new int[4][6];//row column
//OR
//q1, q2,q3,q4
int[][] sales = { {2,3,4,5},//2014
{7,8,9,10},//2015
int sideStart =400;
int xStart = 50;
int yStart = 410;
void setup(){
size(600,420);
}
void draw(){
import java.util.Scanner;
/**
* A simple class to run the Magpie class.
* @author Laurie White
* @version April 2012
*/
public class MagpieRunner2
{
/**
* 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>
* This version uses a nested if to handle default responses.
* @author Laurie White