Playing the same code on pycharm and vscode. User is X!
Thursday, September 30, 2021
Recurs
Downloaded ttt code lastnight
https://github.com/juanesmendez/CS50-AI-Project0-tictactoe/blob/master/tictactoe.py
Plays OK:
Tuesday, September 28, 2021
More tic
My grasp of Python is just not up to the task; and I need
help to see what the coding paradigm I am trying for might look
like. So tomorrow, back to YouTube:
Monday, September 27, 2021
German Elections
source: Libération, published on September 25, 2021
author: Lucie Claudon
translation: GoogleTranslate/ doxa-louise
EPLANATION
German elections 2021: one polling day, but two votes
German federal elections 2021
The citizens of Germany are called to the polls this Sunday to designate the members of the Bundestag who will choose the one who will succeed Angela Merkel.
This Sunday, 60.4 million Germans are called to the polls and, of these, 2.8 million will be able to vote for the first time. As in France, the right to vote is granted to all citizens over 18 years of age; they are thus automatically registered on the electoral listls.
How are elections conducted?
Since 1949, the year of the creation of the Federal Republic of Germany, the election has been conducted according to a mixed system of majority vote and personalized proportional representation. Unlike France, Germans citizens have two votes. On the one hand, citizens vote for the candidate for their constituency, who will sit as a member of the Bundestag (the equivalent of the National Assembly). In all, 299 parliamentarians are elected at the end of a uninominal vote by simple majority, said by "the first vote": the candidate obtaining the most votes, even without an absolute majority, is elected.
On the other hand, voters vote for parties, represented by national lists. This second vote is the most important because it defines the proportional distribution of the total number of seats in the Bundestag. Votes can be taken either by post or at a polling station.
The parties having access to Parliament are only those who obtained at least 5% of all the second votes. In theory, the Parliament consists of 598 members, but it happens that certain parties obtain more members by the direct way than by the proportional one. The number of seats is then increased. Since 2017, 709 MPs have been sitting. They are the ones who elect the chancellor, whose mandate lasts 4 years.
Who is in the running?
A total of 47 parties present 6,211 candidates, either on party lists or individually in constituencies across Germany. The six main parties which hope to share the seats in the Bundestag are the CDU (Christian Democrats), the SPD (Social Democrats) - the two great historic parties -, the environmentalists of Die Grünen (The Greens), the populist movement of extreme right (AfD), the liberals (FDP) and the radical left party Die Linke.
When will we know the future chancellor?
The parties are led to form coalitions at the end of the results, except if they obtain an absolute majority. This last happened in 1961. The Christian Democrats then won 50.2% of the vote and 270 seats. The time for negotiations can be long. After the 2017 elections, Angela Merkel's last term in office, it took her 117 days to arrive at a so-called black-red-yellow coalition (re party colors), which brings together the Social Democrats (SPD) and the liberals (FDP). Which makes local prognosticators say that Angela Merkel could stay in the chancellery ... until Christmas .
* * *
Sunday, September 26, 2021
Debug
With Python code from the below site, running a debug session
in VSCode.
https://www.sqlshack.com/how-to-debug-python-scripts-in-visual-studio-code/
Saturday, September 25, 2021
Solve
The proposed code works like a charm, for both the small
and the large data set:
The code, and very much modelled on that in the maze problem.
It is BFS:
DEBUG
I have - up to this point - tested my code by writing
in print commands at varios points. This is more complicated, and
I now need to learn how to use a debugger to see what is going on.
so be it:
Friday, September 24, 2021
Assignment degrees
A little moment in coder confusion here. I need to remind
myself to think like a programmer, and not a coder. So far:
https://www.geeksforgeeks.org/python-return-statement/
* * *
Thursday, September 23, 2021
Assignment(s)
I cold just tip-toe through this course the way I
did with the last: etting an overview. Bit thisone is
closerto what I already know about , like propositional
calculus in Logic. So, yep, I am going to be trying my hand
at the assignments. And get some real experience with python
The first lecture assignment has two elements:
degrees, which consists of writing code to find the degree of
separation between actores from their film roles.
Tic-tac-toe ( you guessed it), writing the play code for the computer.
Have downloaded the code packages; starting tomorrow morning.
Wednesday, September 22, 2021
Minimax
Moving on with adversarial games, my AI lecture presented an Interesting explication
of the Minimax, here thebasis for the pseudocode describing how a computer might play
( and win at) tic tac toe. The idea is to play another game in which X is trying to maximize
the score, and 0 is trying to minimize it. A terminal win for X is +1, one for O is -1,
and a draw is 0.
I can use alpha beta pruning to diminish the number of iterations: some paths
are discourging from the get-go.
There are 255, 168 possible tic tac toe games. No computer is going to calculate
all that. An algorithm that shows more probabilities of winning might be
good enough!! (Depth-limited minimax).
* * *
(Don't want to misrepresent things here. Tic tac toe is always a draw if
both sides play optimally 👧. And because the board can be turned and/or flipped
- think see-through board - there are only three games, depending on
where the first move is) .
* * *
GOT IT!!
Fall is here...
Tuesday, September 21, 2021
Morning After
Congratulations to all who partcipated in yesterday's election:
that was true grit, in difficult times.
From Wikipedia, the results in 2019 qnd 2021.(There was 1 Independent in 2019)
Monday, September 20, 2021
Sunday, September 19, 2021
Vote
So Conrad Black thinks the only rational thing to do in this
election is vote for Erin O'Toole. I wouldn't know: this election was
so cutesy we didn't get to hear about some of the really important
stuff, like International Affairs. Yet there it is, front and foremost in the
news. If Australia gets those nuclear-powered missiles - with bomb capability -
then China sees no alternative then to put them on the list of those
who should be bombed in the eventuality of war.
What?? Did I miss a turn here? Big to-do about no one paying their NATO
dues under Donald Trump, but that is NATO. North Atlantic Treaty Organiaztion,
yesterday's war. The rumble is on somewhere else, in the Pacific. I looked
up if Canada had any submarines: we have four, and they are very well taken care of.
They do exercises...in the Mediterranean. But a smaller country than us, with a
population of 25 million, is buying a lot of them, and getting grief from China about it.
It's a different game.
I am not trying to paint China as the enemy. But having them produce a lot of our
material things and clothes has circulated quite a bit of money their way, which
lets them buy things like Vancouver properties, tuition at Oxford, Chanel bags. We
are tangled with them in various legal issues as well, such as the two Michaels. And
don't get me going on the pandemic.
Distressing to me is that the major party leaders are all Quebecers: Truseau, Blanchet,
O'Toole. And with his law degree, J.Singh might as well be one. All trying to balance
culture and demography. Is there no institutional reponse to this that might allow us to move
forward!?
Oh, and I think that Yves-Francois Blanchet - with a degree in Anthropology and History
fromthe U. de M - should have been Minister of External Affairs during the whole
Afghanistan crisis. Stop repeating himself..., earn his salary...
Thus from me: vote for the mp of your choice, and hang tight!
https://www.independent.co.uk/
Saturday, September 18, 2021
Search Algorithms
There are two basic search algorithms examined in our lecture. One can
move between them by merely changing the code at line 128 from between
stack and queue.
Definitions
DFS (stack):
Here, DFS stops at a long path. DFS is trusted for maze problems with a uniquesolution.
* * *