Wing Tsun Bali
![Wing Tsun Bali](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmpKaQm4jwV1Rr9zi4Ax2p8aVnQeRBBgsSv2hOzbw9FUD3ABd6akifYvq5ozwvn_-pmdUuc8X4qJ1or9Vp0pL19EOF6vgRO0M2PwA9fxvPChVY2BnlC0NSMqz1TTK81oDUJgpX3t72FQk/s1600/FB_IMG_1526140003308.jpg)
Blog ini akan di fokuskan untuk memuat informasi seni beladiri wing chun (umum) dan mendetail ke intern PERGURUAN WING CHUN di Bali, salah satunya adalah Perguruan WING TSUN BALI SURYA DEWATA (WTBSD) disini penulis merupakan murid resmi perguruan WING TSUN BALI sejak akhir Oktober 2011, dan aktif sampai saat ini
Featured
beberapa contoh animasi
// ulara II
#include
#include
#include
#include
#include
#include
#include
#include
int main()
{
// source code anda
int ULANGTERUS=1;
// konstanta arah
int KANAN = 0;
int KIRI = 1;
int ATAS = 2;
int BAWAH = 3;
//pada saat awal ular akan bergerak ke kanan
int ARAH=KANAN;
//konstanta batas
int BATASATAS = 6;
int BATASBAWAH = 10;
int BATASKIRI = 2;
int BATASKANAN = 45;
//mengatur badan ular
//sim1 = simbol untuk kepala
//sim2 = simbol untuk badan
//sim3 = simbol untuk ekor
char sim1='X';
char sim2='o';
char sim3='o';
//mengatur posisi ular
//posX1, posY1 = menentukan posisi kepala
//posX2, posY2 = menentukan posisi badan
//posX3, posY3 = menentukan posisi ekor
int posX1=BATASKIRI+2, posY1=BATASATAS+2;
int posX2=1, posY2=1;
int posX3=1, posY3=1;
printf("==============================================\n");
printf("== RATTLE SNAKE : ULAR BERJALAN TDK TERATUR ==\n");
printf("== Author : VnP ==\n");
printf("== http://cplusplusindonesia.blogspot.com ==\n");
printf("=============================================\n\n");
gotoxy(1,12); printf("KELUAR Tekan sembarang tombol\n");
//inisialisasi proses random
srand(time(NULL));
while(ULANGTERUS)
{
}
//gambar ular
gotoxy(posX1,posY1); printf("%c",sim1);
gotoxy(posX2,posY2); printf("%c",sim2);
gotoxy(posX3,posY3); printf("%c",sim3);
delay(150);
//hapus ular pada posisi lama
gotoxy(posX1,posY1); printf(" ");
gotoxy(posX2,posY2); printf(" ");
gotoxy(posX3,posY3); printf(" ");
//ubah posisi
posX3=posX2;
posY3=posY2;
posX2=posX1;
posY2=posY1;
//kita hanya perlu mengontrol posisi kepala
//dalam hal ini, posisi dari sim1
//arah dari ular diganti
if(ARAH==KANAN)
{
if(posX1>=BATASKANAN) ARAH= (rand()%100)%4;
else
posX1+=1;
} else
if(ARAH==BAWAH)
{
if(posY1>=BATASBAWAH) ARAH=(rand()%100)%4;
else
posY1+=1;
} else
if(ARAH==KIRI)
{
if(posX1<=BATASKIRI) ARAH=(rand()%100)%4; else posX1= 1; } else if(ARAH==ATAS) { if(posY1<=BATASATAS) ARAH=(rand()%100)%4; else posY1= 1; } //cek penekanan sembarang tombol if(kbhit()) break; } return 0;
#include
#include
#include
#include
#include
#include
#include
#include
int main()
{
// source code anda
int ULANGTERUS=1;
// konstanta arah
int KANAN = 0;
int KIRI = 1;
int ATAS = 2;
int BAWAH = 3;
//pada saat awal ular akan bergerak ke kanan
int ARAH=KANAN;
//konstanta batas
int BATASATAS = 6;
int BATASBAWAH = 10;
int BATASKIRI = 2;
int BATASKANAN = 45;
//mengatur badan ular
//sim1 = simbol untuk kepala
//sim2 = simbol untuk badan
//sim3 = simbol untuk ekor
char sim1='X';
char sim2='o';
char sim3='o';
//mengatur posisi ular
//posX1, posY1 = menentukan posisi kepala
//posX2, posY2 = menentukan posisi badan
//posX3, posY3 = menentukan posisi ekor
int posX1=BATASKIRI+2, posY1=BATASATAS+2;
int posX2=1, posY2=1;
int posX3=1, posY3=1;
printf("==============================================\n");
printf("== RATTLE SNAKE : ULAR BERJALAN TDK TERATUR ==\n");
printf("== Author : VnP ==\n");
printf("== http://cplusplusindonesia.blogspot.com ==\n");
printf("=============================================\n\n");
gotoxy(1,12); printf("KELUAR Tekan sembarang tombol\n");
//inisialisasi proses random
srand(time(NULL));
while(ULANGTERUS)
{
}
//gambar ular
gotoxy(posX1,posY1); printf("%c",sim1);
gotoxy(posX2,posY2); printf("%c",sim2);
gotoxy(posX3,posY3); printf("%c",sim3);
delay(150);
//hapus ular pada posisi lama
gotoxy(posX1,posY1); printf(" ");
gotoxy(posX2,posY2); printf(" ");
gotoxy(posX3,posY3); printf(" ");
//ubah posisi
posX3=posX2;
posY3=posY2;
posX2=posX1;
posY2=posY1;
//kita hanya perlu mengontrol posisi kepala
//dalam hal ini, posisi dari sim1
//arah dari ular diganti
if(ARAH==KANAN)
{
if(posX1>=BATASKANAN) ARAH= (rand()%100)%4;
else
posX1+=1;
} else
if(ARAH==BAWAH)
{
if(posY1>=BATASBAWAH) ARAH=(rand()%100)%4;
else
posY1+=1;
} else
if(ARAH==KIRI)
{
if(posX1<=BATASKIRI) ARAH=(rand()%100)%4; else posX1= 1; } else if(ARAH==ATAS) { if(posY1<=BATASATAS) ARAH=(rand()%100)%4; else posY1= 1; } //cek penekanan sembarang tombol if(kbhit()) break; } return 0;
Comments
Post a Comment