summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-ssssnake.spec272
-rw-r--r--sources1
3 files changed, 274 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..bdd8d6e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/SSSsnake-0.0.24.tar.gz
diff --git a/python-ssssnake.spec b/python-ssssnake.spec
new file mode 100644
index 0000000..adf725c
--- /dev/null
+++ b/python-ssssnake.spec
@@ -0,0 +1,272 @@
+%global _empty_manifest_terminate_build 0
+Name: python-SSSsnake
+Version: 0.0.24
+Release: 1
+Summary: IPythonDisplayTurtles edited for my school's python courses
+License: MIT License
+URL: https://github.com/atahan-git/SSSsnake
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/84/3a/6f66f089db2d1452e21853b3a92578613b8fc5ca8a1779704a0d10dfe073/SSSsnake-0.0.24.tar.gz
+BuildArch: noarch
+
+Requires: python3-IPython
+Requires: python3-IPythonDisplayTurtle
+
+%description
+# SSSsnake
+IPythonDisplayTurtle with addded functionality for our schools python classes.
+
+How to install from a terminal/command prompt:
+
+ pip install SSSsnake
+
+To install from a jupyter notebook cell:
+
+ !pip install SSSsnake
+
+How to use:
+```python
+# Code adapted from one of the exercises made for my school
+
+from SSSsnake import SSSsnake
+### VVV this segment can be hidden from students!
+snake = SSSsnake(homeX = 0, homeY = 7)
+def houseAtXY(x,y):
+ return [[x-1,y,3],[x+1,y,1],[x+2,y,4],[x+2,y+1,0],[x+2,y+2,0],[x+2,y+3,5],[x+1,y+3,1],[x,y+3,1],[x-1,y+3,2],[x-1,y+2,0],[x-1,y+1,0]]
+walls = [];doors = [];walls.extend(houseAtXY(2,0));doors.append([2,0,1]);walls.extend(houseAtXY(7,1));doors.append([7,1,1]);walls.extend(houseAtXY(12,2));doors.append([12,2,1])
+snake.drawLevel(xSize=16, ySize=8, gridSize=25, walls=walls, doors=doors)
+snake.speed(10)
+
+snake.pendown() # the snake can do more than you think! It can Draw!
+
+# --------------------- vv Work zone vv ---------------------
+
+def smartmove(amount):
+ for i in range(amount):
+ snake.forward()
+
+# TODO: define a function, Hint: you can use the smart move from before here as well!
+# Also this snake knows how to turn left :)
+### you would leave the function empty for the students to fill!
+def drawncolumn(height):
+ snake.left()
+ smartmove(height)
+ snake.right()
+ snake.forward()
+ snake.right()
+ smartmove(height)
+ snake.left()
+
+
+# TODO: draw 3 collumns of length 3, 2, and 1, under the houses!
+
+smartmove(2)
+drawncolumn(3)
+smartmove(4)
+drawncolumn(2)
+smartmove(4)
+drawncolumn(1)
+smartmove(2)
+
+
+
+# --------------------- ^^ Work zone ^^ ---------------------
+
+snake.display()
+```
+
+![Example Turtle](Example.png)
+
+[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/atahan-git/SSSsnake/master)
+
+
+
+%package -n python3-SSSsnake
+Summary: IPythonDisplayTurtles edited for my school's python courses
+Provides: python-SSSsnake
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-SSSsnake
+# SSSsnake
+IPythonDisplayTurtle with addded functionality for our schools python classes.
+
+How to install from a terminal/command prompt:
+
+ pip install SSSsnake
+
+To install from a jupyter notebook cell:
+
+ !pip install SSSsnake
+
+How to use:
+```python
+# Code adapted from one of the exercises made for my school
+
+from SSSsnake import SSSsnake
+### VVV this segment can be hidden from students!
+snake = SSSsnake(homeX = 0, homeY = 7)
+def houseAtXY(x,y):
+ return [[x-1,y,3],[x+1,y,1],[x+2,y,4],[x+2,y+1,0],[x+2,y+2,0],[x+2,y+3,5],[x+1,y+3,1],[x,y+3,1],[x-1,y+3,2],[x-1,y+2,0],[x-1,y+1,0]]
+walls = [];doors = [];walls.extend(houseAtXY(2,0));doors.append([2,0,1]);walls.extend(houseAtXY(7,1));doors.append([7,1,1]);walls.extend(houseAtXY(12,2));doors.append([12,2,1])
+snake.drawLevel(xSize=16, ySize=8, gridSize=25, walls=walls, doors=doors)
+snake.speed(10)
+
+snake.pendown() # the snake can do more than you think! It can Draw!
+
+# --------------------- vv Work zone vv ---------------------
+
+def smartmove(amount):
+ for i in range(amount):
+ snake.forward()
+
+# TODO: define a function, Hint: you can use the smart move from before here as well!
+# Also this snake knows how to turn left :)
+### you would leave the function empty for the students to fill!
+def drawncolumn(height):
+ snake.left()
+ smartmove(height)
+ snake.right()
+ snake.forward()
+ snake.right()
+ smartmove(height)
+ snake.left()
+
+
+# TODO: draw 3 collumns of length 3, 2, and 1, under the houses!
+
+smartmove(2)
+drawncolumn(3)
+smartmove(4)
+drawncolumn(2)
+smartmove(4)
+drawncolumn(1)
+smartmove(2)
+
+
+
+# --------------------- ^^ Work zone ^^ ---------------------
+
+snake.display()
+```
+
+![Example Turtle](Example.png)
+
+[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/atahan-git/SSSsnake/master)
+
+
+
+%package help
+Summary: Development documents and examples for SSSsnake
+Provides: python3-SSSsnake-doc
+%description help
+# SSSsnake
+IPythonDisplayTurtle with addded functionality for our schools python classes.
+
+How to install from a terminal/command prompt:
+
+ pip install SSSsnake
+
+To install from a jupyter notebook cell:
+
+ !pip install SSSsnake
+
+How to use:
+```python
+# Code adapted from one of the exercises made for my school
+
+from SSSsnake import SSSsnake
+### VVV this segment can be hidden from students!
+snake = SSSsnake(homeX = 0, homeY = 7)
+def houseAtXY(x,y):
+ return [[x-1,y,3],[x+1,y,1],[x+2,y,4],[x+2,y+1,0],[x+2,y+2,0],[x+2,y+3,5],[x+1,y+3,1],[x,y+3,1],[x-1,y+3,2],[x-1,y+2,0],[x-1,y+1,0]]
+walls = [];doors = [];walls.extend(houseAtXY(2,0));doors.append([2,0,1]);walls.extend(houseAtXY(7,1));doors.append([7,1,1]);walls.extend(houseAtXY(12,2));doors.append([12,2,1])
+snake.drawLevel(xSize=16, ySize=8, gridSize=25, walls=walls, doors=doors)
+snake.speed(10)
+
+snake.pendown() # the snake can do more than you think! It can Draw!
+
+# --------------------- vv Work zone vv ---------------------
+
+def smartmove(amount):
+ for i in range(amount):
+ snake.forward()
+
+# TODO: define a function, Hint: you can use the smart move from before here as well!
+# Also this snake knows how to turn left :)
+### you would leave the function empty for the students to fill!
+def drawncolumn(height):
+ snake.left()
+ smartmove(height)
+ snake.right()
+ snake.forward()
+ snake.right()
+ smartmove(height)
+ snake.left()
+
+
+# TODO: draw 3 collumns of length 3, 2, and 1, under the houses!
+
+smartmove(2)
+drawncolumn(3)
+smartmove(4)
+drawncolumn(2)
+smartmove(4)
+drawncolumn(1)
+smartmove(2)
+
+
+
+# --------------------- ^^ Work zone ^^ ---------------------
+
+snake.display()
+```
+
+![Example Turtle](Example.png)
+
+[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/atahan-git/SSSsnake/master)
+
+
+
+%prep
+%autosetup -n SSSsnake-0.0.24
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-SSSsnake -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.24-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..82f0a9a
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+0939b7a5aa6016180ddf043a4393b61b SSSsnake-0.0.24.tar.gz