564 karma · joined June 20, 2011
There were iZettles in many Helsinki cafés a few years ago, but it seems to me that most of them have been replaced by normal PoS terminals.
Answer: O(1), since it could be written as one big lookup table from game state to optimal move. To get a nontrivial complexity class, you have to have some parameter that can vary, so e.g. the question "what's the time complexity of a program that plays perfect chess on an n-by-n board?" (assuming a suitable generalization of the chess rules is given) is much harder to answer.
Only if you provide the tool with the stems of the words. For example, the genitive ending is -n, but the genitive stem of käsi is käde- and the stem of aasi is aasi- and figuring that out might not be within the reach of a two-evening tool.
https://en.wikipedia.org/wiki/Finnish_grammar#Noun/adjective...
https://www.finlex.fi/fi/laki/ajantasa/2019/20190872#L4P13 (doesn't seem to be available in English at this time)
> The prospects for increasing the flexibility of working time will be examined with a view to balancing the harmonisation of work and family and prolonging working careers. The aim in particular is to improve part-time working opportunities for parents of small children and for those who are caring for elderly relatives.
http://julkaisut.valtioneuvosto.fi/handle/10024/161935 (there's a PDF link on the page)
https://utcc.utoronto.ca/~cks/space/blog/programming/GoIsGoo...
Note that the keys are in columns and not staggered, so there is a learning curve.
(Source: https://utcc.utoronto.ca/~cks/space/blog/web/MozillaStillTru... )
1. The syntax of comprehensions led me to think that they introduce some kind of a variable binding, such as `let` in many Lisps, and that binding `lookup[x]` would have been a syntax error. Of course Python didn't introduce anything like that for comprehensions, and it's just a normal assignment operation, with an extra scope inserted in Python 3 to stop `x` leaking into the enclosing scope.
2. Because of the swap idiom `x, y = y, x` I thought tuple assignment happens somehow in parallel, so my code should have caused an undefined variable error, even if it is not a syntax error. But of course it just evaluates the right hand side first and then assigns to the left hand side in left-to-right order, which the language reference https://docs.python.org/3/reference/simple_stmts.html#assign... notes "sometimes result[s] in confusion" (near the end of the section).
Python 3.7.1 (default, Nov 28 2018, 21:47:25)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: lookup = {}
In [2]: [x for (x, lookup[x]) in ('ab', 'cd', 'ef') if x in lookup]
Out[2]: ['a', 'c', 'e']
In [3]: lookup
Out[3]: {'a': 'b', 'c': 'd', 'e': 'f'}