Skip to content

Instantly share code, notes, and snippets.

@Osinko
Osinko / RandomTest.cs
Created November 9, 2018 16:17
シャッフルしたカードのシミュレーション
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public class RandomTest : MonoBehaviour
{
void Start()
{
OpenCardSampling(100f, 61, 39, 3);
@Osinko
Osinko / HatInTimeTrnsHelper.cs
Last active October 14, 2018 14:03
HatInTimeの翻訳を支援するunity用のプログラム
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using System.Text.RegularExpressions;
using System.Linq;
public class CharSetHelper : MonoBehaviour
{
void Start()
@Osinko
Osinko / regTest1
Created September 19, 2018 08:37
Regex.Matchesに関してLINQの利用
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using UnityEngine;
public class regTest1 : MonoBehaviour
{
void Start()
{
@Osinko
Osinko / FnFn
Created January 9, 2018 19:10
フィボナッチ数列の近似を黄金比で出力
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class FnFn : MonoBehaviour
{
//フィボナッチ数列の近似を黄金比で出力
void Start()
{
int length = 10;
@Osinko
Osinko / DD
Created January 9, 2018 07:07
値から特定桁の数字を抽出
using UnityEngine;
using System.Collections;
public class DD : MonoBehaviour
{
void Start()
{
print(Digit(123456789, 6)); //7桁目を表示(変数digは0を含んでカウントしている)
}
@Osinko
Osinko / DD
Created January 9, 2018 07:07
値から特定桁の数字を抽出
using UnityEngine;
using System.Collections;
public class DD : MonoBehaviour
{
void Start()
{
print(Digit(123456789, 6)); //7桁目を表示(変数digは0を含んでカウントしている)
}
@Osinko
Osinko / DD
Created January 9, 2018 07:07
値から特定桁の数字を抽出
using UnityEngine;
using System.Collections;
public class DD : MonoBehaviour
{
void Start()
{
print(Digit(123456789, 6)); //7桁目を表示(変数digは0を含んでカウントしている)
}
@Osinko
Osinko / DD
Created January 9, 2018 07:07
値から特定桁の数字を抽出
using UnityEngine;
using System.Collections;
public class DD : MonoBehaviour
{
void Start()
{
print(Digit(123456789, 6)); //7桁目を表示(変数digは0を含んでカウントしている)
}
@Osinko
Osinko / DD
Created January 9, 2018 07:07
値から特定桁の数字を抽出
using UnityEngine;
using System.Collections;
public class DD : MonoBehaviour
{
void Start()
{
print(Digit(123456789, 6)); //7桁目を表示(変数digは0を含んでカウントしている)
}
@Osinko
Osinko / nCr
Created January 9, 2018 07:03
組合せ計算
//組合せ計算
public int nCr(int n, int r)
{
if (n == r || r == 0) return 1;
int deno = n;
int nume = 1;
for (int i = 2; i <= r; n--, i++)
{
deno *= (n - 1);