블로그 이미지
Leeway is... the freedom that someone has to take the action they want to or to change their plans.
maetel

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
  • total
  • today
  • yesterday

Category

2008. 3. 28. 12:59 @GSMC/정문열: Generative Art
2008-03-28 금 11시 @504

Data Type
1) boolean
2) byte
3) char
4) int
5) float
6) color

* float이 memory를 훨씬 많이 차지하므로 정수는 int로 선언한다.
float f;
f = 2.7;
int i = (int) f;  //i=2가 된다.

똑같은 성질을 가지는 변수들이 여러 개일 때 array를 쓴다.
1024*768 (1280*1024)

변수명 붙이는 요령:
1. meaning
2. 소문자+대문자 (eg. roomTemp)


1) element: VarX (10%), VarY(30%), A(40%), B(20%)
2) array를 만든다 (길이 10)
     {VarX, VarY, VarY, VarY, A, A, A, A, B, B}
a) random number를 선택한다
rnum = random(0, 1)    (-> 항상 float)
rnum = random(0, 10)
(int) rnum
b) if (0~4) {VarX}



'@GSMC > 정문열: Generative Art' 카테고리의 다른 글

class 5/1  (0) 2008.05.01
Class와 Object  (0) 2008.04.14
class 3/27  (0) 2008.03.27
tree (data structure)  (0) 2008.03.24
class 3/20  (0) 2008.03.20
posted by maetel