Learning-Python-Team / word-game-tool

Basic tool to help players of word games, based around Scrabble, find the score of their words and assist them selecting the optimal word
MIT License
7 stars 8 forks source link

board_builder.py #29

Open JiggsUK opened 5 years ago

JiggsUK commented 5 years ago

Function: create_board Purpose: Creates a blank board ready for use Acceptance Criteria:

  1. Function that builds the base scrabble board including locations of bonus point tiles such as double/triple word and letter score tiles
  2. Must include letter/number labelling to allow a user to select a tile location later

Function: view_board Purpose: When called, this displays the state of the current board Acceptance Criteria:

  1. Displays the board in the console
Levi-Lesches commented 5 years ago

Can I propose we change the top-level function create_board to just Board()?

JiggsUK commented 5 years ago

If you like, but it might conflict with the class name? I thought functions were supposed to be named for what they are doing, usually with a verb - but there are so many different rules for languages that I might have mixed that up with java or c# lol

JiggsUK commented 5 years ago

@nakulkd has made some great changes to the board_builder file that can create/build/view a board. @webdotorg has started a board build using pygame (Word_Game_Board.py) which also looks awesome. That gives us a couple of options to play with - is there a preference? pygame might have more sustainability?

Levi-Lesches commented 5 years ago

I'll look over the code and see if I can create some sort of structure, but in general, we should prefer OOP instead of global functions. Once you get into "magic methods", OOP is absolutely fantastic.

webdotorg commented 5 years ago

Can someone please take a look at the Word_Game_Board file? (Not the file committed to the Phase II branch). Thanks!

webdotorg commented 5 years ago

I've got the skeleton of the board built using pygame. With a lot of help from Jiggs, we sped up the program so it won't crash. I'd like to overlay the text on the tiles now, e.g., "Triple Word Score" on each red tile. I've hit a few roadblocks, so help is welcomed.

JiggsUK commented 5 years ago

image

I'm working on the text display and am almost there - should be able to do a PR this weekend for it... I hope

JiggsUK commented 5 years ago

Once the PR is merged the board will display the words on the multiplier tiles - now need to figure out how to get our console app part into a pygame app....