Skip to content

Instantly share code, notes, and snippets.

View Myoga1012's full-sized avatar

Myoga Suibashi Myoga1012

View GitHub Profile
@Myoga1012
Myoga1012 / Calendar.cs
Last active January 30, 2023 07:23
C#でカレンダーを出力するソースコードです。
// 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
// Twitter : https://twitter.com/Myoga1012
using System;
namespace Myoga1012_Cal {
class Program {
static void Main( string[] args ) {
// 現在の日付を取得から当月1日を表すインスタンスを生成します。
@Myoga1012
Myoga1012 / Calendar.vb
Last active January 30, 2023 07:31
Excelのワークシートにカレンダー出力するVBAのモジュールです。
' 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
' Twitter : https://twitter.com/Myoga1012
Sub Calendar()
Dim now As Date
now = Date
Dim iday As Date
iday = DateSerial(Year(now), Month(now), 1)
@Myoga1012
Myoga1012 / Calendar.fs
Last active January 30, 2023 07:37
【旧バージョン】F#でカレンダーを出力するソースコードです。
// 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
// Twitter : https://twitter.com/Myoga1012
open System;
[<EntryPoint>]
let main argv =
// 現在の日付を取得し、当月1日の曜日と末日を求めます。
let now = DateTime.Today
@Myoga1012
Myoga1012 / Calendar.cs
Last active January 30, 2023 07:44
XAMLでカレンダーを出力するコードです。ロジック用コードは初期化のみです。
// ロジック用コードです。主役はXAMLのコードだよ。
using System.Windows;
namespace WPF {
public partial class MainWindow : Window {
public MainWindow() { InitializeComponent(); }
}
}
@Myoga1012
Myoga1012 / Calendar.nako
Last active January 30, 2023 07:48
なでしこでカレンダーを出力するスクリプトです。
# 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
# Twitter : https://twitter.com/Myoga1012
母艦の0、0を$FFF5DEE2で塗る。 # 薄い撫子色
当月1日は「{今年}/{今月}/01」。
当月日数は当月1日と「{今年}/{来月}/01」の日数差。
オフセットで1から当月1日の曜日番号取得まで繰り返す
「 」と継続表示。
@Myoga1012
Myoga1012 / Calendar.f95
Last active January 30, 2023 08:13
FORTRAN 95でカレンダーを出力するコードです。
! 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
! Twitter : https://twitter.com/Myoga1012
program main
character*10 dummy(3)
integer*4 now(8)
integer*4 firstDate
integer*4 i, day
call date_and_time( dummy(1), dummy(2), dummy(3), now )
@Myoga1012
Myoga1012 / Calendar.js
Last active January 30, 2023 08:16
TypeScriptでカレンダーを出力するソースコードです。
// Visual StudioでそのTypeScriptファイルをビルドした時に生成されるJavaScriptコードです。
window.onload = function () {
// 現在日を取得し、当月1日の曜日と末日を求めます。
var now = new Date();
var prePad = new Date(now.getFullYear(), now.getMonth(), 1).getDay();
var lastDay = new Date(now.getFullYear(), now.getMonth() + 1, 0).getDate();
// カレンダーを出力します。
var el = document.getElementById('content');
@Myoga1012
Myoga1012 / Calendar.cob
Last active January 30, 2023 08:22
COBOLでカレンダーを出力するソースコードです。
* 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
* Twitter : https://twitter.com/Myoga1012
* Calender for COBOL (OpenCOBOL)
IDENTIFICATION DIVISION.
PROGRAM-ID. Calender.
DATA DIVISION.
WORKING-STORAGE SECTION.
@Myoga1012
Myoga1012 / Calendar.dtl
Last active January 30, 2023 08:24
ドリトルでカレンダーを出力するソースコードです。
// 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
// Twitter : https://twitter.com/Myoga1012
// 現在の日付と曜日を取得します。
現在年 = ( システム ! 年? ). 現在月 = ( システム ! 月? ). 現在日 = ( システム ! 日? ).
現在曜日 = ( システム ! 曜日? ).
// 曜日を文字から数値( 日曜 : 0、月曜 : 1、・・・、土曜 : 6 )に変換します。
「現在曜日 == "日"」 ! なら「現在曜日 = "0"」
そうでなければ「「現在曜日 == "月"」 ! なら「現在曜日 = "1"」
@Myoga1012
Myoga1012 / Calendar.cpp
Last active January 30, 2023 08:25
C++ / CLIでカレンダーを出力するソースコードです。
// 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
// Twitter : https://twitter.com/Myoga1012
#include "stdafx.h"
#include <stdio.h>
using namespace System;
int main( array<System::String ^> ^args ) {