day8

# Day 8

## Teams

1. Sana, Aibat
2. Nurbal, Zarina
4. Azim, Aisulu
6. Anvar, Eldana
7. Olzhas, Aruzhan
8. Bibinur, Lyailya

## Lesson

• Algorithms
• Sorting
• Artificial Intelligence

## Assignment/Homework

1. Blog - Pick 3 topics. Write a post about the most interesting topic to present on the last day. Why do you like it? Why would people find this interesting? Pick 3 from these:
1. Twine - Interactive fiction and creating a story
2. Github - Managing code
3. Arduino - Electronics
4. Algorithms - Solving problems
5. Artificial Intelligence - Machines and humans
6. Processing - Programming language
7. Animations/Graphics - Motion and images
8. Game Design - What is a game?
9. Roles of Development - Types of jobs
10. Blogging with Jekyll - What is a blog and how to make one
2. Processing
1. Rock Paper Scissors
2. Tic Tac Toe ← FSM
3. Sorting
4. Design a game using a dice - This game is like Train and that Dragon Cancer. It is meant to help people realize an issue in the world to improve it. Do a 1 page design document. You can draw on pencil and paper or do it digitally. If it's digital, then do post on your blog.
```int x = 30;
int dx = 0;

int y = 20;
int dy = 0;

void setup() {
size (500,500);

}

void draw() {
//background(255,255,0);
fill(random(256),random(256),random(256));

ellipse(x,y,20,20);

if (keyPressed && key == 'd') {
dx = 1;
}
else {
dx = 0;
}

if (keyPressed && key == 's') {
dy = 1;
}
else {
dy = 0;
}

x = x+dx;
y = y+dy;

if (keyPressed && key == 'a') {
dx = -1;
}
else {
dx = 0;
}

if (keyPressed && key == 'w') {
dy = -1;
}
else {
dy = 0;
}

x = x+dx;
y = y+dy;

}```
```int userInput = 0;
int computerInput = 0;

void setup() {
size(400,400);
}

void draw() {
background(0);

textSize(32);
text("(r)ock (p)aper (s)cissors", 10, 30);
textSize(20);
text("Press Space to Start Over", 10, 50);

// AI Code
computerInput = 2;

if (userInput == 0) {
if (keyPressed && key == 'r') {
userInput = 1;
}
else if (keyPressed && key == 'p') {
userInput = 2;
}
}
else if (userInput == 1) {

text("User plays rock", 50, 200);

if (computerInput == 2)
text("Computer plays paper", 50, 250);

if (userInput == 1 && computerInput == 2){
text("You Lose", 50, 100);
}
}
else if (userInput == 2) {
text("User plays paper", 50, 200);

}

else if (userInput == 3) {
text("User plays rock", 50, 200);
}

if (keyPressed && key == ' ') {
userInput = 0;
}

}```  