---
# System prepended metadata

title: UKRAINE TETRIS

---

# UKRAINE TETRIS
## D1149682 林允勝

## 選擇難度介面
![](https://hackmd.io/_uploads/ByuJU45U3.png)

## 新增關卡難度:
1. easy
2. hard
3. insane 

|     | easy           | hard | insane |
| --- | -------------- | ---- | ------ |
|  方塊掉落速度   | 慢 |    中  |    快   |
|  新增方塊      | 無| 新增2種  | 再新增2種 |

## hard 與 insane 新增之方塊
hard:
1. ![](https://hackmd.io/_uploads/B1BEvEqUn.png) 十字
2. ![](https://hackmd.io/_uploads/H1prPNqUn.png) 3*3的方塊

inasane:
1. ![](https://hackmd.io/_uploads/Skstv4qI2.png) 很難放的圖形
2. ![](https://hackmd.io/_uploads/BJ0owV9L3.png) 5*5的愛心

## 新增程式碼部分
mode
```c=
 int mode,time_sleep=0,block_num;
    printf("select mode: 1 = easy 2 = hard 3=insane\n");
    scanf("%d", &mode);
    if (mode == 1) {
        time_sleep = 100;
        block_num = 7;
    }
    if (mode == 2) {
        time_sleep = 70;
        block_num = 9;
    }
    if (mode == 3) {
        time_sleep = 40;
        block_num = 11;
    }
logic(canvas, &state,block_num);
```
hard
```c=
{
        .shape = X,
        .color = PURPLE,
        .size = 3,
        .rotates =
        {
            {
                {1, 1, 1},
                {1, 1, 1},
                {1, 1, 1}
            },

            {   {1, 1, 1},
                {1, 1, 1},
                {1, 1, 1}
            },
            {
                {1, 1, 1},
                {1, 1, 1},
                {1, 1, 1}
            },
            {
                {1, 1, 1},
                {1, 1, 1},
                {1, 1, 1}
            }
        }
    },
    {
        .shape = C,
        .color = RED,
        .size = 3,
        .rotates =
        {
            {
                {0, 1, 0},
                {1, 1, 1},
                {0, 1, 0}
            },

            {   {0, 1, 0},
                {1, 1, 1},
                {0, 1, 0}
            },
            {
                {0, 1, 0},
                {1, 1, 1},
                {0, 1, 0}
            },
            {
                {0, 1, 0},
                {1, 1, 1},
                {0, 1, 0}
            }
        }
    },
```
insane
```c=
//char rotates[5][5][5];
 {
        .shape = WTF1,
        .color = RED,
        .size = 4,
        .rotates =
        {
            {
                {0, 1, 0, 0},
                {1, 1, 1, 1},
                {0, 1, 1, 0},
                {0, 1, 0, 0}
            },
            {
                {0, 0, 1, 0},
                {1, 1, 1, 1},
                {0, 1, 1, 0},
                {0, 0, 1, 0}
            },
            {
                {0, 0, 1, 0},
                {0, 1, 1, 0},
                {1, 1, 1, 1},
                {0, 0, 1, 0}
            },
            {
                {0, 1, 0, 0},
                {1, 1, 1, 1},
                {0, 1, 1, 0},
                {0, 1, 0, 0}
            }
        }
    },
    {
        .shape = WTF2,
        .color = RED,
        .size = 5,
        .rotates =
        {
            {
                {0, 1, 0, 1, 0},
                {1, 0, 1, 0, 1},
                {1, 0, 0, 0, 1},
                {0, 1, 0, 1, 0},
                {0, 0, 1, 0, 0}
            },
            {
                {0, 0, 1, 1, 0},
                {0, 1, 0, 0, 1},
                {1, 0, 0, 1, 0},
                {0, 1, 0, 0, 1},
                {0, 0, 1, 1, 0}
            },
            {
                {0, 0, 1, 0, 0},
                {0, 1, 0, 1, 0},
                {1, 0, 0, 0, 1},
                {1, 0, 1, 0, 1},
                {0, 1, 0, 1, 0}
            },
            {
                {0, 1, 1, 0, 0},
                {1, 0, 0, 1, 0},
                {0, 1, 0, 0, 1},
                {1, 0, 0, 1, 0},
                {0, 1, 1, 0, 0}
            }
        }
    },
```
## 實際遊玩畫面
{%youtube utiDqOUlK9s %}
 

