Skip to content

Instantly share code, notes, and snippets.

View takanakahiko's full-sized avatar
😸
😸

takanakahiko

😸
😸
View GitHub Profile
@takanakahiko
takanakahiko / CosWave.java
Created January 6, 2015 14:49
コサイン波の観測。ゲームとかのふわふわ表現に使えるやつね。(1.6)
public class CosWave{
public static void main(String[] args){
int n = Integer.parseInt(System.console().readLine("いくつまでやりますか? ->"));
double PI = 3.14;
for(int i = 0; i < n; i ++){
try{
Thread.sleep(100);
}catch(InterruptedException e){}
int m = 10+(int)(10*Math.cos(PI*i/10));
for(int j = 0; j < m; j++)
@takanakahiko
takanakahiko / Even.java
Created January 7, 2015 07:55
例外クラスの作成の学習。これでも正しいのかさっぱり(1.7)
class EvenException extends Exception{};
class OddException extends Exception{};
class Even{
static void isEven(int i) throws EvenException, OddException{
if(i%2 == 0){
throw new EvenException();
}else{
throw new OddException();
}
@takanakahiko
takanakahiko / TinyPong.java
Created January 8, 2015 09:03
ブロック崩し作ったけどガバガバ仕様(1.8)
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class myPanel extends JPanel implements ActionListener, KeyListener{
int x = 30, y = 20;
int dx = 12, dy = 5, d = 30;
int padY = 55;
int pd = 0;
Timer pTimer;
@takanakahiko
takanakahiko / ForFor.java
Last active August 29, 2015 14:13
繰り返しの繰り返し
class ForFor{
public static void main(String[] args){
System.out.println("a回繰り返す中でb回繰り返すよ!");
int a = Integer.parseInt(System.console().readLine("a="));
int b = Integer.parseInt(System.console().readLine("b="));
for(int i = 0; i < a; i++){ //a回繰り返す
for(int j = 0; j < b; j++){ //b回繰り返す
@takanakahiko
takanakahiko / test.java
Last active August 29, 2015 14:13
テスト
@takanakahiko
takanakahiko / Hoge.java
Created January 10, 2015 10:27
abcチャレンジ
class Hoge{
public static void main(String args[]){
int max = 500; //上限
int hantei = 0;
int n = 0;
int i = 0;
for(i = 0; i < max; i++){
n =(int)(Math.random()*3);
abstract class SushiYa{
static void vote(){
System.out.println("�ӉZ���i");
}
}
class Daisou extends SushiYa{
static void vote(){
System.out.println("���m���i");
}
}
@takanakahiko
takanakahiko / index.html
Created February 5, 2015 15:36
HTML雛形
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>タイトル</title>
</head>
<body>
ここに内容
</body>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MTGマン</title>
</head>