From e71dc44752fe30240fa3fa7eb97c15583dd552f9 Mon Sep 17 00:00:00 2001 From: AnkitSingh-16 <98884735+AnkitSingh-16@users.noreply.github.com> Date: Fri, 14 Oct 2022 19:48:49 +0530 Subject: [PATCH 1/2] Create Alphabet Rangoli.py --- Python/Alphabet Rangoli.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Python/Alphabet Rangoli.py diff --git a/Python/Alphabet Rangoli.py b/Python/Alphabet Rangoli.py new file mode 100644 index 0000000..5f50a1d --- /dev/null +++ b/Python/Alphabet Rangoli.py @@ -0,0 +1,24 @@ +Alphabet Rangoli + +// code + + + + + +def print_rangoli(size): + + import string + design = string.ascii_lowercase + + L = [] + for i in range(n): + s = "-".join(design[i:n]) + L.append((s[::-1]+s[1:]).center(4*n-3, "-")) + + print('\n'.join(L[:0:-1]+L)) + + +if __name__ == '__main__': + n = int(input()) + print_rangoli(n) From 839ea4ba5900e985b84f223b55fc3a5de405e3cb Mon Sep 17 00:00:00 2001 From: AnkitSingh-16 <98884735+AnkitSingh-16@users.noreply.github.com> Date: Fri, 14 Oct 2022 19:57:10 +0530 Subject: [PATCH 2/2] Create botclean stochastic.py --- Python/botclean stochastic.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Python/botclean stochastic.py diff --git a/Python/botclean stochastic.py b/Python/botclean stochastic.py new file mode 100644 index 0000000..85b9f32 --- /dev/null +++ b/Python/botclean stochastic.py @@ -0,0 +1,31 @@ +botclean stochastic + +#code + + + + +def nextMove(posr, posc, board): + dirty_row = dirty_col = 0 + for i in range(len(board)): + for j in range(len(board[i])): + if board[i][j] == 'd': + dirty_row = i + dirty_col = j + + if dirty_col < posc: + print('LEFT') + elif dirty_col > posc: + print('RIGHT') + elif dirty_row < posr: + print('UP') + elif dirty_row > posr: + print('DOWN') + else: + print('CLEAN') + + +if __name__ == "__main__": + pos = [int(i) for i in input().strip().split()] + board = [[j for j in input().strip()] for i in range(5)] + nextMove(pos[0], pos[1], board)