---
# System prepended metadata

title: 411042004 曾巧曦 L型 LED

---

# 411042004 曾巧曦 L型 LED
```python=
from microbit import*

for i in range(5):
  for j in range(i+1):
    x1=4-i;
    y1=j;
    x2=4-j;
    y2=i;
    if (i !=j):
      display.set_pixel(x1, y1,9)
      display.set_pixel(x2, y2,9)
    else:
      display.set_pixel(x1,y1,9)
      print(x1,y1)
  sleep(300)
for i in range(4, -1,-1):
  for j in range(i+1):
    x1=4-i;
    y1=j;
    x2=4-j;
    y2=i;
    if (i !=j):
      display.set_pixel(x1, y1,0)
      display.set_pixel(x2, y2,0)
    else:
      display.set_pixel(x1,y1,0)
  sleep(300)
 
 
  #i=4   j=0,1,2,3,4
  #(4,0) (4,0)i=0 j=0
  #(3,0)(3,1)  (3,1)(4,1)i=1 j=0,1
  #(2,0)(2,1)(2,2)  (2,2)(3,2)(4,2)i=2 j=0,1,2
  #(1,0)(1,1)(1,2)(1,3)  (1,3)(2,3)(3,3)(4,3)i=3 j=0,1,2,3
  #(0,0)(0,1)(0,2)(0,3)(0,4)  (0,4)(1,4)(2,4)(3,4)(4,4)i=4 j=0,1,2,3,4
```

