Write a program that prints the numbers from 1 to 100. However, for multiples of three, print "fizz" instead of the number. For the multiples of five, print "buzz", instead of the number. For numbers which are multiples of both three and five, print "fizzbuzz".
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.io.File; | |
import java.io.FileNotFoundException; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Scanner; | |
public class MarkTwainWroteIt { |
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 static void step() { | |
boolean[][] newGrid = new boolean[50][50]; | |
for (int x = 0 ; x < 50 ; x++) { | |
for (int y = 0 ; y < 50 ; y++) { | |
// Get how many neighbors this cell has. | |
int count = neighbors(x, y); | |
// 1. If the square is alive, but has less than two neighbors, it dies. | |
if (grid[x][y] == true && count < 2) { |
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 zen.core.Zen; | |
public class Card { | |
public static final int HEART = 1; | |
public static final int DIAMOND = 2; | |
public static final int SPADE = 3; | |
public static final int CLOVER = 4; | |
public static final int JACK = 11; |
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 zen.core.Zen; | |
public class Play2048 { | |
static int[][] board; | |
private static final int UP = 0; | |
private static final int DOWN = 1; | |
private static final int LEFT = 2; | |
private static final int RIGHT = 3; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
/* Style the things in the page */ | |
body { | |
} | |
button { | |
test
haha