This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Fantasynamengenerator (python3) | |
"""generates fantasy names""" | |
def namensgenerator(namen): | |
"""im docstring in triple-quotes beschreibt man was die funktion tut""" | |
namensliste = [] | |
output = "" | |
while len(namensliste) < anzahl: | |
neuername = (random.choice(namen[0]))+(random.choice(namen[1])) | |
if neuername not in namensliste: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Caesar Cipher | |
# from Al Sweigarts invent with python book https://inventwithpython.com/chapter14.html | |
MAX_KEY_SIZE = 26 | |
def getMode(): | |
while True: | |
print('Do you wish to encrypt or decrypt a message?') | |
mode = input().lower() | |
if mode in 'encrypt e decrypt d'.split(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
# legende: # Fels . Boden T Troll ! trap | |
dungeon = """ | |
############################################### | |
#......................bbb.....#.....#........# | |
#.............................................# | |
#.............................................# | |
############################################### | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""tictactoe game for 2 players | |
from blogpost: http://thebillington.co.uk/blog/posts/writing-a-tic-tac-toe-game-in-python by BILLY REBECCHI, | |
slightly improved by Horst JENS""" | |
from __future__ import print_function | |
choices = [] | |
for x in range (0, 9) : | |
choices.append(str(x + 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Links und Unterlagen zum Seminar "Unterrichten mit Python" | |
# python | |
http://python.org - download | |
offizielle Dokumentation der Module (z.B. turtle modul) -> Documentaion -> Library Reference -> Modul aussuchen, | |
z.B. turtle Modul: | |
https://docs.python.org/3/library/turtle.html | |
## Tutorials für Python: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# legend: #=rock .=floor f=food T=treasure | |
dungeon = """ | |
############################################### | |
#.....fff.#..............#f#.T#.....#.......#T# | |
#.........#..............###....###.#.....#.#.# | |
#.........f.....T...f.........##T......f..#...# | |
############################################### | |
""" # add more line to the dungeon! | |
player, msg = "@", "welcome @, move with w,a,s,d" | |
px, py, dx, dy = 1, 1, 0, 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# legend: #=rock .=floor f=food T=treasure | |
dungeon = """ | |
############################################### | |
#.....fff.#..............#f#.T#.....#.......#T# | |
#..S......#..............###....###.#.....#.#.# | |
#..SS.....f.....T...f.........##T......f..#...# | |
############################################### | |
""" # add more line to the dungeon! | |
player, msg = "@", "welcome @, move with w,a,s,d" | |
px, py, dx, dy, php = 1, 1, 0, 0, 10 # position, movement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
# legend: #=rock .=floor f=food T=treasure | |
dungeon = """ | |
############################################### | |
#.....fff.#..............#f#.T#.....#.......#T# | |
#..S......#..............###....###.#.....#.#.# | |
#..SS.....f.....T...f.........##T......f..#...# | |
############################################### | |
""" # add more line to the dungeon! | |
player, msg = "@", "welcome @, move with w,a,s,d" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# legend: #=rock .=floor f=food $=gold | |
DUNGEON = ''' | |
############################################### | |
#.....fff.#..............#f#.$#.....#.......#$# | |
#.........#..............###....###.#.....#.#.# | |
#.........f.....$...f.........##$......f..#...# | |
############################################### | |
''' # add more lines to the dungeon! | |
PLAYER = '@' | |
PROMPT = 'Type your command or ? and press Enter:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# legend: #=rock .=floor f=food $=gold | |
DUNGEON = ''' | |
############################################### | |
#.....fff.#..............#f#.$#.....#.......#$# | |
#.........#..............###....###.#.....#.#.# | |
#.........f.....$...f.........##$......f..#...# | |
############################################### | |
''' # add more lines to the dungeon! | |
PLAYER = '@' | |
PROMPT = 'Type your command or ? and press Enter:' |