Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using if statements
#5
(Mar-20-2019, 06:56 AM)bradystroud Wrote: Also, the scoring system is broken, The sum of the score of the remaining letters from hand should be subtracted from the users total score

I don't see where you are removing the letters used, so that needs to be done. I would be best if player's hand was stored as a list, but you could convert it with list() and convert it back with ''.join(). If it's in a list you can loop through the word letters and use the remove() method to take them out of the list.

Then you need to score them as you are scoring the words (I would create a separate function for scoring an arbitrary string of letters), and subtract them from the total score.

There is not enough information here to diagnose why single letters are considered acceptable. It seems it would have to be a problem with acceptable_words. I would look at the file that generates that, maybe exclude single letter words when you read it. 'a' is a word, even if it's not valid in Scrabble.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Using if statements - by bradystroud - Mar-19-2019, 09:13 AM
RE: Using if statements - by Larz60+ - Mar-19-2019, 03:23 PM
RE: Using if statements - by ichabod801 - Mar-19-2019, 03:40 PM
RE: Using if statements - by bradystroud - Mar-20-2019, 06:56 AM
RE: Using if statements - by ichabod801 - Mar-20-2019, 01:55 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020