Upload
gary-chang
View
215
Download
2
Embed Size (px)
DESCRIPTION
A_Little_Bit_Processing_Tutorial
Citation preview
Processing
Hello World & Variable& Setup
01HELLO世界&變數
&設定
Now We Code it.終於可以寫程式了^_^
print (“Hello World !!!”);open close
stringFunction
END
Remember to end with “;”記得結尾要 “;”
Type what I tell you in this AREAThen press “play” (compile) to “RUN” the code
1
2
在空白處打上字然後按RUN
You will see that what you type, is coming right here!This is your “FIRST CODE!”
3
下面就會出現結果
Print (“Hello Kitty !!!”);open close
stringFunction
END
VARIABLE參數
int(integer)
float(floating numbers)
string
boolean
NAME
1,2,3,4,5…99,1304
EXAMPLE
0.5, 2.78, 3.1415….
HappyBody
True or False
整數
小數
字串
布林
Declare the VariablesLet computer knows who you are
int x;
float y; this is “y” and it is a floating number
this is “x” and it is an integer
宣告參數
這是 x 它是一個整數
這是 y 它是一個帶小數的數字
int x;x=100;
float y = 20.845;
println(x); println(y); println(“x+y=” + x+y);
Declare the Variables
write it in 2 lines.
write it in 1 lines.
寫成兩行
寫成一行
CODE
RESULT
RESULT
STOP CACULATE PLEASE!!!!!!!!!!!
我不要算拉!!!
SET UP設定
void setup(){//basic setup, run once}
void draw(){//draw something, run as loop}
基本設定 跑一次
捉傷心(畫東西) 跑跑跑一直跑
ellipse (locX, loxY, Xr, Yr);open close
stringFunction
END
200
20
0
0 500
50
0
50
Are you Bored?無聊否?
Fill color
填色
Background
refresh
If you put
this in draw
背景刷新如果你把此放在draw
1
2
3
4
void setup(){
size(500,500);
smooth();
}
void draw(){
fill(mouseX-245, mouseY-245,
(mouseX+mouseY)/10);
ellipse(250,250,mouseX,mouseY);
}
Reference