Skip to content

Instantly share code, notes, and snippets.

@todorok1
todorok1 / DocComment_2.cs
Created April 29, 2020 06:37
summaryタグの例
/// <summary>
/// summaryタグを使うとメソッドやクラスの説明を表示してくれます。
/// </summary>
void SummaryMethod()
{
// 何らかの処理
}
@todorok1
todorok1 / DocComment.cs
Created April 29, 2020 06:01
ドキュメントコメントの例
/// <Summary>
/// ドキュメントコメントについて解説するためのクラスです。
/// </Summary>
public class DocCommentClass : MonoBehaviour
{
/// <Summary>
/// フィールドの説明も書けます。
/// </Summary>
public int docId;
@todorok1
todorok1 / comment.cs
Created April 28, 2020 06:55
コメント文の書き方(おさらい)
// コメント文を書くときには「//」を使おう。
int comment = 0; // 行の途中からでもコメント文を書けます。
/*
複数行に渡ってコメントを書きたいときには
スラッシュとアスタリスクを組み合わせます。
*/
// 複数行のコメントを書くときには
@todorok1
todorok1 / HelloWorld.cs
Created September 30, 2019 06:58
UnityでHello World! を表示する世界で一番簡単なスクリプト
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HelloWorld : MonoBehaviour
{
void Start()
{
Debug.Log("Hello World!");
}
@todorok1
todorok1 / bubble_sort_log.txt
Created August 30, 2019 13:42
バブルソートアルゴリズムのC#実装の実行例。
元の配列
26, 400, 19, 504, 8, 500, 58, 14, 401, 168, 13
処理中の様子
1週目の処理 : 26, 19, 400, 8, 500, 58, 14, 401, 168, 13, 504
2週目の処理 : 19, 26, 8, 400, 58, 14, 401, 168, 13, 500, 504
3週目の処理 : 19, 8, 26, 58, 14, 400, 168, 13, 401, 500, 504
4週目の処理 : 8, 19, 26, 14, 58, 168, 13, 400, 401, 500, 504
5週目の処理 : 8, 19, 14, 26, 58, 13, 168, 400, 401, 500, 504
6週目の処理 : 8, 14, 19, 26, 13, 58, 168, 400, 401, 500, 504
@todorok1
todorok1 / shaker_sort_log.txt
Created August 30, 2019 13:41
シェーカーソートアルゴリズムのC#実装の実行例。
元の配列
26, 400, 19, 504, 8, 500, 58, 14, 401, 168, 13
処理中の様子
1週目の処理
配列の大きさは11、中身は : 26, 19, 400, 8, 500, 58, 14, 401, 168, 13, 504
配列の大きさは11、中身は : 8, 26, 19, 400, 13, 500, 58, 14, 401, 168, 504
2週目の処理
配列の大きさは11、中身は : 8, 19, 26, 13, 400, 58, 14, 401, 168, 500, 504
配列の大きさは11、中身は : 8, 13, 19, 26, 14, 400, 58, 168, 401, 500, 504
@todorok1
todorok1 / odd_even_sort_log.txt
Created August 30, 2019 13:40
奇偶転置ソートアルゴリズムのC#実装の実行例。
元の配列
26, 400, 19, 504, 8, 500, 58, 14, 401, 168, 13
処理中の様子
1週目の処理
配列の大きさは11、中身は : 26, 400, 19, 504, 8, 500, 14, 58, 168, 401, 13
配列の大きさは11、中身は : 26, 19, 400, 8, 504, 14, 500, 58, 168, 13, 401
2週目の処理
配列の大きさは11、中身は : 19, 26, 8, 400, 14, 504, 58, 500, 13, 168, 401
配列の大きさは11、中身は : 19, 8, 26, 14, 400, 58, 504, 13, 500, 168, 401
@todorok1
todorok1 / comb_sort_log.txt
Created August 30, 2019 13:38
コムソートアルゴリズムのC#実装の実行例。
元の配列
26, 400, 19, 504, 8, 500, 58, 14, 401, 168, 13
処理中の様子
1週目の処理 h : 8
配列の大きさは11、中身は : 26, 168, 13, 504, 8, 500, 58, 14, 401, 400, 19
2週目の処理 h : 6
配列の大きさは11、中身は : 26, 14, 13, 400, 8, 500, 58, 168, 401, 504, 19
3週目の処理 h : 4
配列の大きさは11、中身は : 8, 14, 13, 168, 26, 500, 19, 400, 401, 504, 58
@todorok1
todorok1 / gnome_sort_log.txt
Created August 30, 2019 13:37
ノームソートアルゴリズムのC#実装の実行例。
元の配列
26, 400, 19, 504, 8, 500, 58, 14, 401, 168, 13
*** 最終結果 ***
配列の大きさは11、中身は : 8, 13, 14, 19, 26, 58, 168, 400, 401, 500, 504
処理回数は 70 回、 交換回数は 31 回でした。
@todorok1
todorok1 / quick_sort_log.txt
Created August 30, 2019 13:34
クイックソートアルゴリズムのC#実装の実行例。
元の配列
26, 400, 19, 504, 8, 500, 58, 14, 401, 168, 13
処理中の様子
ExecuteQuickSortが呼ばれました。中身は : 26, 400, 19, 504, 8, 500, 58, 14, 401, 168, 13
配列の大きさは11、中身は : 13, 14, 19, 8, 504, 500, 58, 400, 401, 168, 26
左側の範囲 13 から 8 まで / 右側の範囲 504 から 26 まで
ExecuteQuickSortが呼ばれました。中身は : 13, 14, 19, 8, 504, 500, 58, 400, 401, 168, 26
配列の大きさは11、中身は : 8, 14, 19, 13, 504, 500, 58, 400, 401, 168, 26