Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SpartanBotsOutlab67
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Roshan Rabinarayan
SpartanBotsOutlab67
Commits
0785b64c
Commit
0785b64c
authored
Oct 03, 2020
by
Samarth Joshi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.cse.iitb.ac.in/sroshan/SpartanBotsOutlab67
parents
5e3a6c60
a70eded4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
1 deletion
+46
-1
q1/triwizard.py
q1/triwizard.py
+46
-1
No files found.
q1/triwizard.py
View file @
0785b64c
...
...
@@ -86,7 +86,52 @@ def incendio(my_integer):
# 'm': integer that divides n
# return type: int numpy Ndarray; dim: nxn
def
alohomora
(
n
,
m
):
pass
checkerboard
=
np
.
zeros
((
n
,
n
),
dtype
=
int
)
turn
,
count
,
row_turn
,
row_count
=
(
0
,
0
,
0
,
0
)
for
row
in
range
(
len
(
checkerboard
)):
if
row_turn
==
0
and
row_count
<
m
:
for
col
in
range
(
len
(
checkerboard
[
0
])):
if
(
turn
==
0
and
count
<
m
):
checkerboard
[
row
][
col
]
=
1
count
+=
1
if
(
count
>=
m
):
turn
=
1
count
=
0
elif
(
turn
==
1
and
count
<=
m
):
count
+=
1
if
(
count
+
1
>
m
):
turn
=
0
count
=
0
turn
=
0
row_count
+=
1
if
(
row_count
>=
m
):
row_turn
=
1
row_count
=
0
turn
=
1
continue
if
row_turn
==
1
and
row_count
<
m
:
for
col
in
range
(
len
(
checkerboard
[
0
])):
if
(
turn
==
0
and
count
<
m
):
checkerboard
[
row
][
col
]
=
1
count
+=
1
if
(
count
>=
m
):
turn
=
1
count
=
0
elif
(
turn
==
1
and
count
<=
m
):
count
+=
1
if
(
count
+
1
>
m
):
turn
=
0
count
=
0
turn
=
1
row_count
+=
1
if
(
row_count
>=
m
):
row_turn
=
0
row_count
=
0
turn
=
0
continue
return
checkerboard
# ---- Task (d) -------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment