Skip to content

Instantly share code, notes, and snippets.

View mizucoffee's full-sized avatar
🌊

GOTO Ritsuki mizucoffee

🌊
View GitHub Profile
The MIT License (MIT)
Copyright (c) 2015 Ritsuki Goto
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@mizucoffee
mizucoffee / Array_Haiku.java
Last active August 29, 2015 14:17
プログラミング生放送 俳句コンテスト Array ver.
import java.util.Random;
public class Array_Haiku {
public static void main(String[] args) throws Exception {
int num = 6;//俳句の数
int ran = new Random().nextInt(num);//変数ranにnumの数の乱数を振る
String[] data = new String[num];//配列の定義
data[0] = "プログラマ/いのちけずって/今日も行く";//配列の中に、内容を入力。"/"で分ける
@mizucoffee
mizucoffee / Short_Haiku.java
Last active August 29, 2015 14:17
プログラミング生放送 俳句コンテスト Short ver.
import java.util.Random;
public class Short_Haiku {
public static void main(String[] args) throws Exception {
String data = "プロ生ちゃん / プログラマーの/  癒しの子 ";
String[] strAry = data.split("/");
for (int i = 0; i < 7; i++){
System.out.print(strAry[2].substring(i,i+1));
System.out.print(strAry[1].substring(i,i+1));
@mizucoffee
mizucoffee / DataRead_Haiku.java
Last active August 29, 2015 14:17
プログラミング生放送 俳句コンテスト 外部ファイル読み込み ver.
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Random;
import java.io.File;
import java.io.FileReader;
import java.io.FileNotFoundException;
import java.io.IOException;
public class DataRead_Haiku {
static int n = 0;