タグ: programming
Docker: Accelerated, Containerized Application Development
ttps://www.docker.com/
PHP 引数
<?php
function showAd()
{
echo ‘———-‘ . PHP_EOL;
echo ‘— Ad —‘ . PHP_EOL;
echo ‘———-‘ . PHP_EOL;
}
showAd();
echo ‘Tom is great!’ . PHP_EOL;
echo ‘Bob is great!’ . PHP_EOL;
showAd();
echo ‘Steve is great!’ . PHP_EOL;
echo ‘Bob is great!’ . PHP_EOL;
showAd();
PHP 関数
<?php
function showAd()
{
echo ‘———-‘ . PHP_EOL;
echo ‘— Ad —‘ . PHP_EOL;
echo ‘———-‘ . PHP_EOL;
}
showAd();
echo ‘Tom is great!’ . PHP_EOL;
echo ‘Bob is great!’ . PHP_EOL;
showAd();
echo ‘Steve is great!’ . PHP_EOL;
echo ‘Bob is great!’ . PHP_EOL;
showAd();
PHP continue break
<?php
for ($i = 1; $i <= 10; $i++) {
//if($i === 4){
//if($i % 3 === 0){
// continue;
//}
if($i === 4){
break;
}
echo $i . PHP_EOL;
}
c# foreach文
<foreach文>
複数の要素をもつものを順番に取り出してくれるループ文
foreach(仮の入れ物 in 取り出し元)
{
}
————————–
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class test : MonoBehaviour
{
void Start()
{
int[] a = {1,2,3,4,5};
foreach (int i in a)
{
Debug.Log(i);
}
}
// Update is called once per frame
void Update()
{
}
}
C# 配列
型[] 配列名 = new 型[要素数];
Unity C# 配列 for文
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class test : MonoBehaviour
{
void Start()
{
int[,,] a = new int[3,4,2];
for(int i = 0; i < a.GetLength(0); ++i)
{
for(int j = 0; j < a.GetLength(1); ++j)
{
for(int k = 0; k < a.GetLength(2); ++k)
{
a[i,j,k] = i + j + k;//代入
Debug.Log(“a[“+ i + “,” + j + “,” + k + “]に代入する”);
}
}
}
}
// Update is called once per frame
void Update()
{
}
}
C# Unity 多次元配列
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class test : MonoBehaviour
{
void Start()
{
int[,,] a = new int[3,4,2];
Debug.Log(a.Length);
Debug.Log(a.GetLength(1));
}
// Update is called once per frame
void Update()
{
}
}
C# Unity 配列
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class test : MonoBehaviour
{
void Start()
{
int[] a = new int[50];
for(int i = 0; i < a.Length; ++i)
{
a[i] = i;
}
}
// Update is called once per frame
void Update()
{
}
}