6 ms·
Tictactoe in PyFL, my experimental functional language
- detaro 5y agoside note: Tic-Tac-Toe you can reasonably just brute-force all possible games to check if something plays perfect or not.
- bade 5y agoI know, the point was to exercise the various PyFL features.
- deleted 5y ago[deleted]
- armanboyaci 5y agoActually, the first moves of the players determines the result. And because of the symetries there are just 12 first moves. My tweets about this topic: https://twitter.com/arman_boyaci/status/1442436923960827913?t=4UMEPJNdMct0EQ8r2gFULg&s=19 https://twitter.com/arman_boyaci/status/1442436923960827913?...
- bade 5y agoYou sound like an expert. Are my heuristics unbeatable?
- armanboyaci 5y agoFor example, when X plays a corner, there is a possibility that your heuristic may play another corner right? In that situation X wins.
- detaro 5y agoif you assume perfect play. Which you can't if you try to confirm your implementation plays perfectly.
- cabalamat 5y agoWhat does 'fby' mean?
- jamespwilliams 5y agoI _think_ (but unsure) that it should be read “followed by”, and only makes sense in the context of a while loop, where `x = y fby z` means that x will take the value of y on the first iteration and z on subsequent iterations.
- bade 5y agoYou're right, the name was borrowed from Lucid, where it is a proper operator on streams.