C#

C# プログラミング メモ 03

using System; using System.Collections.Generic; // MAX, MIN using System.Linq; class Program { /** 最大値、最小値 を出力 : 2変数の最大最小 */ public void Max_and_Min_01(string inputs) { int arr = new int [inputs.Length]; for (int i = 0; i …

C# ソース メモ 02

using System; // リストを使う using System.Collections.Generic; class Program { /** 線形探査 01 入力例1 5 -3 2 0 -1 2 2 出力例1 2 */ public void linear_exploration_01(int loop_num,string inputs, int target ) { int arr = new int[loop_num]; …

C# 競技プログラミング 01 メモ

using System; class Program { /* ある数をある回数表示 1 3 を 8 回、改行区切りで出力 */ public void t_01(int num, int loop_num){ for(var i = 0; i < loop_num; i++) { Console.WriteLine(num.ToString()); } } /* 入力例1 3 8 */ public void t_02(i…

Unity C# オブジェクトからオブジェクト 距離の計算

using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEngine.UI; public class GameDirector : MonoBehaviour { GameObject car; GameObject flag; GameObject distance; // Use this for initialization void Star…

C# ゲーム 2D 移動 スワイプの強さに合わせて  X軸移動 & 効果音

using UnityEngine; using System.Collections; public class CarController : MonoBehaviour { float speed = 0; Vector2 startPos; // Use this for initialization void Start () { } // Update is called once per frame void Update () { if (Input.Get…

C# ゲーム 減速

using UnityEngine; using System.Collections; public class CarController : MonoBehaviour { float speed = 0; // Use this for initialization void Start () { } // Update is called once per frame void Update () { if(Input.GetMouseButtonDown(0))…