From b97ff7d5d9258583c95da82fcb045093cadeaf3f Mon Sep 17 00:00:00 2001 From: Tim Gates Date: Sun, 19 Sep 2021 07:07:54 +1000 Subject: [PATCH] docs: Fix a few typos There are small typos in: - en/pygame/014_sprites.py - en/pygame/015_more_sprites.py - en/pygame/part2step014-sprites.py - en/python/battleship/chat_server.py - en/python/tictactoe/step003c_play_until_bored.py - en/python/tictactoe/step004a_check_win.py - en/python/tictactoe/step006b_medium_ai.py - en/python/tictactoe/step006btest.py - en/python/tictactoe/step006c_parameters.py - examples/image_merge_and_meme.py - examples/pygameMenu.py Fixes: - Should read `detection` rather than `detecttion`. - Should read `columns` rather than `cloumns`. - Should read `influenced` rather than `influened`. - Should read `define` rather than `defnine`. - Should read `smallest` rather than `smalles`. - Should read `leftover` rather than `leftoer`. - Should read `cursor` rather than `coursor`. - Should read `address` rather than `adress`. --- en/pygame/014_sprites.py | 2 +- en/pygame/015_more_sprites.py | 2 +- en/pygame/part2step014-sprites.py | 2 +- en/python/battleship/chat_server.py | 2 +- en/python/tictactoe/step003c_play_until_bored.py | 2 +- en/python/tictactoe/step004a_check_win.py | 2 +- en/python/tictactoe/step006b_medium_ai.py | 2 +- en/python/tictactoe/step006btest.py | 2 +- en/python/tictactoe/step006c_parameters.py | 2 +- examples/image_merge_and_meme.py | 2 +- examples/pygameMenu.py | 8 ++++---- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/en/pygame/014_sprites.py b/en/pygame/014_sprites.py index 9f4006f..5940689 100755 --- a/en/pygame/014_sprites.py +++ b/en/pygame/014_sprites.py @@ -147,7 +147,7 @@ def update(self, seconds): pygame.display.set_caption("[FPS]: %.2f birds: %i" % (clock.get_fps(), len(birdgroup))) - # ------ collision detecttion + # ------ collision detection for bird in birdgroup: bird.catched = False # set all Bird sprites to not catched diff --git a/en/pygame/015_more_sprites.py b/en/pygame/015_more_sprites.py index 8e1fe41..83844e2 100755 --- a/en/pygame/015_more_sprites.py +++ b/en/pygame/015_more_sprites.py @@ -341,7 +341,7 @@ def update(self, seconds): pygame.display.set_caption("ms: %i max(ms): %i fps: %.2f birds: %i gravity: %s bad:%s clever:%s"% (milliseconds, millimax, clock.get_fps(), len(birdgroup), Fragment.gravity, badcoding, clevercoding)) - # ------ collision detecttion + # ------ collision detection for bird in birdgroup: bird.cleanstatus() diff --git a/en/pygame/part2step014-sprites.py b/en/pygame/part2step014-sprites.py index 247be72..6aabd32 100755 --- a/en/pygame/part2step014-sprites.py +++ b/en/pygame/part2step014-sprites.py @@ -137,7 +137,7 @@ def update(self, seconds): pygame.display.set_caption("[FPS]: %.2f birds: %i" % (clock.get_fps(), len(birdgroup))) - # ------ collision detecttion + # ------ collision detection for bird in birdgroup: bird.catched = False # set all Bird sprites to not catched diff --git a/en/python/battleship/chat_server.py b/en/python/battleship/chat_server.py index ee1b977..c8c0325 100644 --- a/en/python/battleship/chat_server.py +++ b/en/python/battleship/chat_server.py @@ -7,7 +7,7 @@ def accept_incoming_connections(): """Sets up handling for incoming clients.""" while True: - client, client_address = SERVER.accept() # client_adress is ip and port + client, client_address = SERVER.accept() # client_address is ip and port print("client {}:{} has connected with server".format(client_address[0], client_address[1])) #client.send(bytes("Welcome to Battleships! Please type your name and press enter!", "utf8")) addresses[client] = client_address diff --git a/en/python/tictactoe/step003c_play_until_bored.py b/en/python/tictactoe/step003c_play_until_bored.py index b9f02ae..6795b12 100644 --- a/en/python/tictactoe/step003c_play_until_bored.py +++ b/en/python/tictactoe/step003c_play_until_bored.py @@ -1,6 +1,6 @@ """tic tac toe for 2 players, without win checking""" -# ----- defnine some top-level variables ------ +# ----- define some top-level variables ------ cells = [[" ", " ", " "], [" ", " ", " "], [" ", " ", " "], diff --git a/en/python/tictactoe/step004a_check_win.py b/en/python/tictactoe/step004a_check_win.py index 64bd526..0ac23ba 100644 --- a/en/python/tictactoe/step004a_check_win.py +++ b/en/python/tictactoe/step004a_check_win.py @@ -1,5 +1,5 @@ """tic tac toe for 2 players, wit win checking""" -# ----- defnine some top-level variables ------ +# ----- define some top-level variables ------ cells = [[" " for x in range(3)] for y in range(3)] symbols = ("x", "o") # tuples are read-only greeting = "This is turn {}. Player {}, where do you put your '{}'?" diff --git a/en/python/tictactoe/step006b_medium_ai.py b/en/python/tictactoe/step006b_medium_ai.py index bc88742..9c66f38 100644 --- a/en/python/tictactoe/step006b_medium_ai.py +++ b/en/python/tictactoe/step006b_medium_ai.py @@ -82,7 +82,7 @@ def choose_free_cell(free_cells, mychar) -> str: def make_human_coordinates(row: int, column: int) -> str: - """returns a human-readable string, cloumns ABC, rows 123""" + """returns a human-readable string, columns ABC, rows 123""" return "ABC"[column]+","+str(row+1) def find_winning_move(mychar: str) -> Optional[str]: diff --git a/en/python/tictactoe/step006btest.py b/en/python/tictactoe/step006btest.py index 5be9af3..940247d 100644 --- a/en/python/tictactoe/step006btest.py +++ b/en/python/tictactoe/step006btest.py @@ -14,7 +14,7 @@ def display() -> None: def make_human_coordinates(row: int, column: int) -> str: - """returns a human-readable string, cloumns ABC, rows 123""" + """returns a human-readable string, columns ABC, rows 123""" return "ABC"[column]+","+str(row+1) diff --git a/en/python/tictactoe/step006c_parameters.py b/en/python/tictactoe/step006c_parameters.py index 998d557..0be7cfd 100644 --- a/en/python/tictactoe/step006c_parameters.py +++ b/en/python/tictactoe/step006c_parameters.py @@ -91,7 +91,7 @@ def choose_a_free_cell(cells: List[List[str]], my_char: str , def make_human_coordinates(row: int, column: int) -> str: - """returns a human-readable string, cloumns ABC, rows 123""" + """returns a human-readable string, columns ABC, rows 123""" return "ABC"[column] + "," + str(row + 1) diff --git a/examples/image_merge_and_meme.py b/examples/image_merge_and_meme.py index bb4e14e..3f9dc9e 100644 --- a/examples/image_merge_and_meme.py +++ b/examples/image_merge_and_meme.py @@ -138,7 +138,7 @@ def get_concat_h_blank(im1, im2, color=(0, 0, 0)): return dst def get_concat_v_blank(im1, im2, color=(0, 0, 0)): - """merge images vertically, leaving blank the leftoer, see https://note.nkmk.me/en/python-pillow-basic/""" + """merge images vertically, leaving blank the leftover, see https://note.nkmk.me/en/python-pillow-basic/""" dst = PIL.Image.new('RGB', (max(im1.width, im2.width), im1.height + im2.height), color) dst.paste(im1, (0, 0)) dst.paste(im2, (0, im1.height)) diff --git a/examples/pygameMenu.py b/examples/pygameMenu.py index 4d91a18..88a62a6 100644 --- a/examples/pygameMenu.py +++ b/examples/pygameMenu.py @@ -84,7 +84,7 @@ def create_menu(self): # ---- video (submenu of settings) ---- # ----list of possible video resolutions without double entries -> set ---- reslist = list(set(pygame.display.list_modes(flags=pygame.FULLSCREEN))) - reslist.sort() # sort the list from smalles resolution to biggest + reslist.sort() # sort the list from smallest resolution to biggest # concert list of tuples( int,int) into list of strings # print("reslist", reslist) reslist = ["x".join((str(x), str(y))) for (x, y) in reslist] @@ -283,12 +283,12 @@ def __init__(self, @property def font(self): - """read only attribute, influened by fontname and fontsize""" + """read only attribute, influenced by fontname and fontsize""" return pygame.font.SysFont(name=self.fontname, size=self.fontsize, bold=True, italic= False) @property def smallfont(self): - """read only attribute, influened by fontname and helptextfontsize""" + """read only attribute, influenced by fontname and helptextfontsize""" return pygame.font.SysFont(name=self.fontname, size=self.helptextfontsize, bold=True, italic=False) def cursor_up(self, menupoints): @@ -425,7 +425,7 @@ def run(self): menupoints = [p for p in self.menu.items] selection = self.menu.items[self.i] # self.menudict[self.menuname][self.i] # ------- cursor animation -------- - # bounce coursor from left to right: + # bounce cursor from left to right: maxcursordistance = 20 ## first value is animation time (lower is slower), second value is travel distance of Curosr #cursordistance = (self.menutime * 20) % 50