dkl
Full Member
Posts: 234
|
Post by dkl on Jan 14, 2022 6:28:39 GMT -5
I can't believe I'm posting this!
I was always taught that if you had
3 apples and multiplied them by 0 then the answer is 3
and
0 apples multiplied them by 3 then the answer is 0
OR
print (3*0) + (0*4) + (2*2) computer answer = 4
my poor brain thinks it's 7
3*0 = 3 0*4 = 0 2*2 = 4
total = 7
but it seems a computer doesn't see it that way! So what do I do to get the computer to see the difference
I've never had this problem before! LOL
|
|
|
Post by tsh73 on Jan 14, 2022 6:52:21 GMT -5
In my part of the world x*0 == 0*x == 0 always. Or so I've been taught in old days.
but (old thing too) in Windows calculator you type 3+2*2<ENTER> and get 10.
(in Standard mode, and 7 in Scientific mode)
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Jan 14, 2022 8:07:06 GMT -5
Hmm … Maths never was my strong point!
I’m thinking in terms of scoring - as in Scrabble. I’ve tried understanding Rod’s way of doing it in his Scrabble Assistant, but I’m afraid it’s beyond me!!
I was thinking like this Grid Pos 1. Grid Pos 2. Grid Pos 3. Grid Pos 4 No Value. Triple. No Value. Double Letter. Word Tile 1. Tile 2. Tile 3. Tile 4 A. S. K. S 1. 1. 5. 1
Then doing grid 1. value x Tile 1 value plus grid 2. value …….. etc. which would give me……
(0*1) + (3*1) + (0*5) + (1) = answer then *2 (for Double Word) OR (1*0) + (1*3) + (5*0) + (1) = answer then *2 (for Double Word)
But that isn’t going to work either way! Hmm…….?
|
|
|
Post by tsh73 on Jan 14, 2022 8:22:00 GMT -5
"no value" in Scrabble happens only if you use empty (wildcard) letter button If "no value" means "ordinary green field with no modificators", letter should be counted by face value, that is <face value>*1
so (1*1) + (1*3) + (5*1) + (1*1) 10 then double it
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Jan 14, 2022 8:35:18 GMT -5
Yes but a blank grid space has no value either so it is not affecting the value of the tile.
However, I now realise if I use the formula I wrote above and just treat the blank grid space as ‘1’ instead of ‘0’ then it’ll work!
If a blank tile is on a blank space it’ll just be 1*0 which is 0, so it’ll be fine.
As you said above - Sorry I didn’t see the last bit of your post till after I finished posting my reply!
|
|
|
Post by Rod on Jan 14, 2022 10:42:37 GMT -5
Yes some fundamental maths misconceptions in there. Zero times anything is zero whether it is the first or second argument. One times anything leaves anything untouched which is the strategy I used. If the square value is one then the tile value is just the tile value if the square value is two the tile is doubled three it is trebled. The word multiplier is applied at the end. I actually changed my code. Currently it only remembered the highest word multiplier it found. Now what I do now is multiply the multiplier. So multiplier starts as one if it finds a double word it gets * two if it finds another double word it gets *2 ie FOUR. Again I was unaware of this rule, so I have learned a lot about Scrabble during the process.
Have fun.
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Jan 14, 2022 18:34:00 GMT -5
Thank you for that advise, Rod. That all makes sense. I was aware of the 'double' multiplier but know various people who do not play it that way and only apply the multiplier once. I've made my board grid and player setup, shuffled my bag and can place words on the board and check the word validity, so now I'm working on the score check before adding the 2nd player. However, I can see quite a few hurdles ahead,once I get to 'crossover' words and multiple words in a single go. It's good to be able to see how you approached the problems and the additions notes about how you did things really help. I've taken a different approach setting up the board etc and I'm using bmpbuttons instead of sprites as I've never used sprites before. However, its fun to do. Have a good weekend
|
|