Saturday, September 13, 2014

[Delivery] Exercise about if

Bài 1: Challenge: Bouncy Ball

My Code



Bài 2: Challenge: Flashy Flash Card 

My Code

Bài này tập dùng if để ra lệnh nếu ấn chuột (mouseIsPressed) thì hiện ra dòng We program in JavaScript here, còn không (else) thì hiện ra dòng What programming language is this.

Bài 3:

My Code


Bài học rút ra: 
  • Cách khác dùng if hiệu quả hơn
    • Cấu trúc: if ( condition ) {statement } else if ( new condition ) { statements } else if...... else { statement }


No comments:

Post a Comment