Python
The week has escalated quickly. I'm "teaching" the program how to play scrabble using a random hand of 7 letters. It whirs up fast when going through and evaluates the permutations. I already have the version working for the human facing game, but scripting the computer to make the best set of choices is something else entirely.
e: the first word I got it to guess on it's own as a "best possible solution" was "haji"... I only know it in the semi-racist context so I had to look it up and figure out what it actually meant
Edited By Troy on 1455692679
e: the first word I got it to guess on it's own as a "best possible solution" was "haji"... I only know it in the semi-racist context so I had to look it up and figure out what it actually meant
Edited By Troy on 1455692679
Hah. I know a former python guru that coded THE optimal solution for scrabble in the English language. Was because his sister used to beat him at it all the time when he was younger.
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
What structure are you using for your word dictionary?Troy wrote:The week has escalated quickly. I'm "teaching" the program how to play scrabble using a random hand of 7 letters. It whirs up fast when going through and evaluates the permutations. I already have the version working for the human facing game, but scripting the computer to make the best set of choices is something else entirely.
e: the first word I got it to guess on it's own as a "best possible solution" was "haji"... I only know it in the semi-racist context so I had to look it up and figure out what it actually meant
Is it using a board, or just making words based on simple point values?
It's not me, it's someone else.
You should look at implementing a trie for the word storage. Super-efficient for word games.Troy wrote:No board yet, just using point values,. The words are in a txt file I load into a list and compare to the permutations.
I got tired of losing in Scrabble to my wife (she loves word games, I tolerate them, sometimes). She said I could write whatever helper I wanted, so I wrote a simple solver, like you are doing. You could input additional letters (to make plays off letters on the board), but I never made it board aware (double/triple point/word/etc)
It's not me, it's someone else.
Crypto? Bah, Mersenne twister or bust.
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
There are Python meetups a few times a month in downtown SF. Tonight will be my third. They are pretty fucking awesome. One of the Django core devs spoke at the last one about using Channels instead of WSGI - and I understand about 1/2 of the things out of his mouth. Then they did a mini Startup Row thing with judges and Startup guys pitching their companies that were powered with Python. It was pretty cool.
Tonight is a project and tutorial night. I'm not useful to anyone to hack on anything yet, so I mostly do the tutorials. Trying to choose between Virtual Environments or Flask. Both are tempting. Leaning towards Virtual.
Did I mention that these are sponsored and always have free beer and food before hand. It's crazy out here.
Edited By Troy on 1458167756
Tonight is a project and tutorial night. I'm not useful to anyone to hack on anything yet, so I mostly do the tutorials. Trying to choose between Virtual Environments or Flask. Both are tempting. Leaning towards Virtual.
Did I mention that these are sponsored and always have free beer and food before hand. It's crazy out here.
Edited By Troy on 1458167756
Yup - raining almost every week, last week every day, since we got here. Taking partial credit for that.
And the rent on our less than 700 SQFT apt in Noe Valley is 3400 a month. And is a steal. 30m commute to Financial District on the train. Cat found it online and had to convince the rental company to let us see and get it. It had show furniture in it(like a success story for their investors of the renovation) and they didn't want to move it out.
Oh hey and Cat got a job last week! She's going to be a Senior Web Producer. She was a hot item out here with her got-an-actual-working-app-off-the-ground experience. She turned down 4 other offers and the Google recruiters are still sniffing around, but that process takes forever and if she spends any more money on expensive chairs were going to be sitting on them under the bridge. Time to get her back in the workforce.
Edited By Troy on 1458228097
And the rent on our less than 700 SQFT apt in Noe Valley is 3400 a month. And is a steal. 30m commute to Financial District on the train. Cat found it online and had to convince the rental company to let us see and get it. It had show furniture in it(like a success story for their investors of the renovation) and they didn't want to move it out.
Oh hey and Cat got a job last week! She's going to be a Senior Web Producer. She was a hot item out here with her got-an-actual-working-app-off-the-ground experience. She turned down 4 other offers and the Google recruiters are still sniffing around, but that process takes forever and if she spends any more money on expensive chairs were going to be sitting on them under the bridge. Time to get her back in the workforce.
Edited By Troy on 1458228097
Re: Python
Still at it, and progressing.
I got a rasberry PI, with a bare LCD screen, and have written in python all the code(from the controller/model standpoint) I need for an in-house bus stop monitor. The LCD came with an optional touchscreen - which I'm trying to figure out if I want to make work in the program or not. The problem i'm trying to address is that I'm tired of checking my phone every few minutes in the morning to see when the bus will arriving. I'd like it on my wall, auto updating. Maybe even giving me a 5 minute warning when it's time to head down when I indicate the bus I want.
I also have been working on some practice problems from an online course. I wrote a robot vacuum program, and simulation w/ visualizer. Classes for the rooms, robots, functions for them to make movement decisions, etc. Pretty rad. And I've learned a little bit about the wonders of GitHub. https://github.com/TasmanS
I got a rasberry PI, with a bare LCD screen, and have written in python all the code(from the controller/model standpoint) I need for an in-house bus stop monitor. The LCD came with an optional touchscreen - which I'm trying to figure out if I want to make work in the program or not. The problem i'm trying to address is that I'm tired of checking my phone every few minutes in the morning to see when the bus will arriving. I'd like it on my wall, auto updating. Maybe even giving me a 5 minute warning when it's time to head down when I indicate the bus I want.
I also have been working on some practice problems from an online course. I wrote a robot vacuum program, and simulation w/ visualizer. Classes for the rooms, robots, functions for them to make movement decisions, etc. Pretty rad. And I've learned a little bit about the wonders of GitHub. https://github.com/TasmanS
Re: Python
Doing optimization and versions of the fabled "Backpack Problem" this week.
Looking at various ways algorithms can pick solutions. As background, they had us solve a problem using brute force to go with our greedy algorithm methods. I brute forced it a little too hard, first time with a Memory error, I backed down to 1-3 combinations out of a set of 200 selections, and it's still locked up the terminal. Need to get on the dynamic programming train.
Looking at various ways algorithms can pick solutions. As background, they had us solve a problem using brute force to go with our greedy algorithm methods. I brute forced it a little too hard, first time with a Memory error, I backed down to 1-3 combinations out of a set of 200 selections, and it's still locked up the terminal. Need to get on the dynamic programming train.
Re: Python
The 0/1 (or discrete) knapsack is a classic dynamic programming problem, any other methodology isn't complete enough. I can dissect every aspect of it in my sleep. The fractional knapsack is much easier.
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."