This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void seedEarth(int coord1, int coord2, int probStat, int probDec) { | |
if(coord1 < gridSize && coord2 < gridSize && coord1 >= 0 && coord2 >= 0) { | |
if(grid[coord1][coord2]!= 1){ | |
grid[coord1][coord2] = 1; | |
if(randomGen.nextInt(100) <= 100 - probStat) { | |
seedEarth(coord1 -1,coord2, probStat + probDec, probDec); | |
} | |
if(randomGen.nextInt(100) <= 100 - probStat) { | |
seedEarth(coord1, coord2-1, probStat + probDec, probDec); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.awt.Color; | |
import java.awt.Dimension; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.util.Random; | |
import javax.swing.JButton; | |
import javax.swing.JComponent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* LineInfo class | |
* | |
* @author sinister | |
* | |
*/ | |
public class LineInfo { | |
private String myLine; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEST |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Assignment2 { | |
private BufferedReader reader; | |
private String str; | |
public static void main(String[] args) { | |
Assignment2 program = new Assignment2(); | |
}// main | |
public Assignment2() throws Exception { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.file "test.c" | |
.text | |
.p2align 4,,15 | |
.globl swap1 | |
.type swap1, @function | |
swap1: | |
.LFB11: | |
.cfi_startproc | |
movl (%rsi), %eax | |
xorl (%rdi), %eax |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color; | |
import java.awt.Dimension; | |
import java.awt.Graphics; | |
import java.awt.Graphics2D; | |
import java.awt.Rectangle; | |
import java.awt.geom.Ellipse2D; | |
import java.awt.geom.Path2D; | |
import javax.swing.JFrame; | |
import javax.swing.JPanel; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class BackedVirtualMemory extends SimpleVirtualMemory { | |
protected int currentPageIndex = 0; | |
protected int pageSize; | |
protected int maxPages; | |
public BackedVirtualMemory(){ | |
this(100, 10); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExtremaTests { | |
// maxArray() | |
// returns the largest value in int array A | |
static int maxArray(int[] A, int start, int end) { | |
if (start < end) { | |
int middle = (start + end) / 2; | |
maxArray(A, start, middle); | |
maxArray(A, middle + 1, end); | |
return Math.max(maxArray(A, start, middle), maxArray(A, middle + 1, end)); | |
}else{ |
NewerOlder