From ed7700749de17497dc343aa53f52c03b427228db Mon Sep 17 00:00:00 2001 From: Zeheng Li Date: Tue, 20 Aug 2024 15:47:38 -0600 Subject: [PATCH] add examples --- src/minesweeper.py | 8 ++++++++ src/skak.lua | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 src/minesweeper.py create mode 100644 src/skak.lua diff --git a/src/minesweeper.py b/src/minesweeper.py new file mode 100644 index 0000000..06cedf0 --- /dev/null +++ b/src/minesweeper.py @@ -0,0 +1,8 @@ +n, m, k = [int(d) for d in input().split()] +b = [] +for _ in range(n): + b.append(list("." * m)) +for _ in range(k): + i, j = [int(d) - 1 for d in input().split()] + b[i][j] = "*" +print("\n".join("".join(r) for r in b)) diff --git a/src/skak.lua b/src/skak.lua new file mode 100644 index 0000000..a708fb3 --- /dev/null +++ b/src/skak.lua @@ -0,0 +1,7 @@ +xh, yh = io.read("*n", "*n") +xp, yp = io.read("*n", "*n") +if xh == xp or yh == yp then + print(1) +else + print(2) +end