Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elvis #6

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Elvis #6

wants to merge 7 commits into from

Conversation

dsyme
Copy link
Contributor

@dsyme dsyme commented Apr 13, 2018

This is the additional changes including the more basic cleanup #5 to make the UI more programmatic in the way that an "Elvis" F# programmer would do it. I think the code in master is right for beginners. Then show this transition.

TicTacToe/App.fs Outdated

match anyMoreMoves model with
| true -> StillPlaying
| false -> Draw

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just if..else?

TicTacToe/App.fs Outdated
/// A helper to get the suffix used in the Xaml for a position on the board.
let uiText (row,col) =
(match row with 0 -> "T" | 1 -> "M" | 2 -> "B" | _ -> failwith "huh?") +
(match col with 0 -> "L" | 1 -> "C" | 2 -> "R" | _ -> failwith "huh?")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pity we loose safety here :( Yes, it's boiler-free, but...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, will adjust

TicTacToe/App.fs Outdated
| Empty ->
match getGameResult model with
| StillPlaying -> true
| _ -> false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getGameResult model = StillPlaying?

@dsyme
Copy link
Contributor Author

dsyme commented Apr 13, 2018

@vasily-kirichenko Thanks for the feedback! I pushed some further updates

@njlr
Copy link

njlr commented Dec 5, 2019

"Elvis" F# programmer

The changes read much better... but what is an "Elvis" F# programmer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants