このGistに上がっているF#ソースファイルの概要
- Haiku.fs : Ver. 1.0, 始めての俳句プログラムです。
- Haiku2.fs : Ver. 2.0, 俳句を縦書きで出力するプログラムです。
[Rainmeter] | |
Author = Nia Tomonaka | |
; Twitter : https://twitter.com/nia_tn1012 | |
Update = 1000 | |
[Metadata] | |
Name = Calendar | |
Description = 現在の月のカレンダーを表示します。 | |
License = Creative Commons BY-NC-SA 3.0 | |
Version = 1.00 |
#pragma once | |
#include "DxLib.h" | |
#include <vector> | |
// sourceの値が、targetのリストのいずれかとマッチするかどうかを判別します。 | |
bool AnyOneOfMatch( char source, std::vector<char> target ) { | |
bool ans = false; | |
std::vector<char>::iterator titer = target.begin(); | |
while( titer != target.end() ) { | |
if( source == *titer++ ) { |
// Auther : Nia Tomonaka | |
// Twitter : https://twitter.com/nia_tn1012 | |
open System // RandomクラスとString.Joinメソッドで必要です。 | |
let rnd = Random() | |
// 0x3041(ぁ)~0x3093(ん)までのUnicodeのひらがなの句をランダムに生成します。 | |
let phrase n = [for i in 1..n -> char( rnd.Next( 0x3041, 0x3094 ) )] | |
// 5・7・5の俳句を作成して出力します。 |
#pragma once | |
#include "DxLib.h" | |
#include <string> | |
// sourceの値が、targetのリストのいずれかとマッチするかどうかを判別します。 | |
bool AnyOneOfMatch( wchar_t source, std::wstring target ) { | |
bool ans = false; | |
std::wstring::iterator titer = target.begin(); | |
while( titer != target.end() ) { | |
if( source == *titer++ ) { |
// 名前 : Nia Tomonaka | |
// Twitter : https://twitter.com/nia_tn1012 | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace Haiku { | |
class Program { | |
static void Main( string[] args ) { |
このGistに上がっているF#ソースファイルの概要
このGistに上がっているXAML、C#ファイルの概要
このGistに上がっているF#ソースファイルの概要 | |
以下のファイルは最新バージョン( Ver. 2.2 )です。F#ではこの Ver. 2.2 で応募します。 | |
Calendar.fs : オリジナルです。コメントによる簡単な解説付き | |
Calendar.fsx : スクリプト版です。コメントによる簡単な解説付き | |
CalendarMin.fs : Calendar.fsと同じ動作をする、ミニマムコードです。サイズは 265バイト( メイン内 230バイト )です。 | |
CalendarMin.fsx : Calendar.fsxと同じ動作をする、ミニマムスクリプトです。サイズは 244バイトです。 | |
CalendarMin2.fs : Calendar.fsで可読性をある程度残しつつ、Minifyしたコードです。 | |
CalendarMin2.fsx : Calendar.fsxで可読性をある程度残しつつ、Minifyしたコードです。 |
// 名前 : Nia Tomonaka | |
// Twitter : https://twitter.com/nia_tn1012 | |
import ceylon.time { Date, date, today } | |
"Run the module `calendar`." | |
shared void run() { | |
// 現在日を取得し、当月1日の曜日と月末日を求めます。 | |
Date now = today(); variable String wl = ""; // wlはカレンダー出力用文字列変数です。 | |
value prePad = date( now.year, now.month, 1 ).dayOfWeek.integer; // 日曜日0始まりです。 |
<!-- | |
名前 : Nia Tomonaka | |
Twitter : https://twitter.com/nia_tn1012 | |
--> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Calendar on Razor ( C# )</title> | |
</head> |