Monday, October 23, 2017
Visual Studio
Apasih Ini Pak Troy Star #KELAS
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class generate : MonoBehaviour {
public int n = 8;
private static int aa=1,bb;
private static string bintang ="*";
private string awalBintang;
// Use this for initialization
void Start () {
bb = n;
for (int i = 1; i <= n; i++) {
awalBintang += bintang;
}
for (int j = n; j <= n && j>=1; j--) {
Debug.Log(awalBintang);
for (int i = 1; i <= n; i++) {
awalBintang += bintang;
}if (n % 2 == 0) {
if (j % 2 == 0) {
awalBintang = awalBintang.Substring (0, aa);
aa++;
} else if (j % 2 != 0) {
bb--;
awalBintang = awalBintang.Substring (0, bb);
}
} else if (n % 2 != 0){
if (j % 2 == 0) {
bb--;
awalBintang = awalBintang.Substring (0, bb);
} else if (j % 2 != 0) {
awalBintang = awalBintang.Substring (0, aa);
aa++;
}
}
}
}
}
0 Response to "Apasih Ini Pak Troy Star #KELAS"
Post a Comment