SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
ChessFidget
You call that chess?
1
The itch
• Like to play chess
• Dislike losing so much
• Too much work to get good
- (For me it would be a dangerous rabbit hole.)
2
The scratch
• Write software to address personal shortcomings
• ChessFidget: a chess app I (currently) always beat
3
Currently looks like this
In lieu of a demo, I'll post code and (Mac) binaries
4
Dev goals/guidelines
• Design for dopamine, not skill
- E.g. no move history
• Computer mostly plays worse chess than I do
- Currently random moves
- That will get boring; see above re: dopamine
• META: Exercise in Swift and reasoning about code
- NOT an exercise in chess programming or AI
5
😬:Agonizing re: modeling
• What are my objects? (Board, Piece, Move, ...)
• In how many places do "business rules" live?
- E.g. MoveValidator and MoveGenerator
- OTOH, might help with mutual unit-testing
• Sometimes the problem was a Swift difficulty
- Extending Grid<T>, T is Piece? vs. T is Bool
• Sometimes the answer was a Swift feature
- Type constraints?
6
"Move" as struct+moveType
enum MoveType {
case resignation
case plainMove
case pawnTwoSquares
case captureEnPassant
case pawnPromotion(type: PromotionType)
case castleKingSide
case castleQueenSide
}
struct Move {
let start: Square
let end: Square
let type: MoveType
}
7
Works fine
awaitingHumanMove
Invalid move e1-g1:
cannotCastleBecauseKingOrRookHasMoved
d1-d2 (plainMove) played by White (Human)
awaitingComputerMove
b8-d7 (plainMove) played by Black (Computer)
awaitingHumanMove
e1-c1 (castleQueenSide) played by White (Human)
awaitingComputerMove
d7-b6 (plainMove) played by Black (Computer)
awaitingHumanMove
8
"Move" as class hierarchy
protocol MoveProtocol {
func updateBoard(_ board: Board)
}
/* The classes would be something like:
Move: MoveProtocol
Resignation
MoveWithStart
PawnTwoSquares
CastleKingSide
CastleQueenSide
MoveWithStartAndEnd
PlainMove
CaptureEnPassant
PawnPromotion */
9
😬:Swift overwhelm
• Building my mental model, esp. re: type system
• Finally past the squirmy phase! 😬➞😊
- New info now gets added to mental framework
• Maybe pairing would have helped?
10
Thoughts about learning
• Know thy brain
- Came to terms with my jumpy learning
- Shlemiel the painter (stay tuned for blog post)
• Be aware when/how reach out to people
11
Other thoughts
• Wow do I suck at chess
• Does writing this app mean I'm a bully at heart?
• Am I weird for sensing uncanny illusion of intent?
- Feels like it's capturing back "on purpose"
- Feels intentional when it checks me
- This despite knowing there is *zero* AI
- WTF it played Fool's Mate
12
Actual early test (Computer=Black)
(manually recreated; wish I'd taken a screenshot)
13
Next (current thinking)
• Find a third-party library, add (weak) AI
• Distinguish between stalemate and checkmate
• Add keyboard input
- Might help me learn algebraic notation
• Add multi-game play
• Move on to other project ideas
14

Weitere ähnliche Inhalte

Ähnlich wie ChessFidget - You call that chess?

Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytesWindows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytesPeter Hlavaty
 
HES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe Shockwave
HES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe ShockwaveHES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe Shockwave
HES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe ShockwaveHackito Ergo Sum
 
Simplicity 2.0 - Get the power back
Simplicity 2.0 - Get the power backSimplicity 2.0 - Get the power back
Simplicity 2.0 - Get the power backRui Carvalho
 
Py chess learning-module
Py chess learning-modulePy chess learning-module
Py chess learning-modulemskmoorthy
 
[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics
[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics
[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basicsnpinto
 
Code quality; patch quality
Code quality; patch qualityCode quality; patch quality
Code quality; patch qualitydn
 
Code quality. Patch quality
Code quality. Patch qualityCode quality. Patch quality
Code quality. Patch qualitymalcolmt
 
vim brownbag - Richard forth
vim brownbag - Richard forthvim brownbag - Richard forth
vim brownbag - Richard forthEdwardElric59
 
How can I get more involved with OpenStack?
How can I get more involved with OpenStack?How can I get more involved with OpenStack?
How can I get more involved with OpenStack?John Garbutt
 
Visibility - the name of the game
Visibility - the name of the gameVisibility - the name of the game
Visibility - the name of the gameAgileee
 
Rasmus, Think Again! Agile Framework == Happy Php Developer
Rasmus, Think Again! Agile Framework == Happy Php DeveloperRasmus, Think Again! Agile Framework == Happy Php Developer
Rasmus, Think Again! Agile Framework == Happy Php DeveloperArno Schneider
 
Lec1cgu13updated.ppt
Lec1cgu13updated.pptLec1cgu13updated.ppt
Lec1cgu13updated.pptRahulTr22
 
Data science programming .ppt
Data science programming .pptData science programming .ppt
Data science programming .pptGanesh E
 
Lec1cgu13updated.ppt
Lec1cgu13updated.pptLec1cgu13updated.ppt
Lec1cgu13updated.pptkalai75
 
Lec1cgu13updated.ppt
Lec1cgu13updated.pptLec1cgu13updated.ppt
Lec1cgu13updated.pptAravind Reddy
 
Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1Abhishek Mishra
 

Ähnlich wie ChessFidget - You call that chess? (20)

Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytesWindows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
 
HES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe Shockwave
HES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe ShockwaveHES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe Shockwave
HES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe Shockwave
 
Simplicity 2.0 - Get the power back
Simplicity 2.0 - Get the power backSimplicity 2.0 - Get the power back
Simplicity 2.0 - Get the power back
 
Py chess learning-module
Py chess learning-modulePy chess learning-module
Py chess learning-module
 
Roadmap
RoadmapRoadmap
Roadmap
 
[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics
[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics
[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics
 
Code quality; patch quality
Code quality; patch qualityCode quality; patch quality
Code quality; patch quality
 
Code quality. Patch quality
Code quality. Patch qualityCode quality. Patch quality
Code quality. Patch quality
 
vim brownbag - Richard forth
vim brownbag - Richard forthvim brownbag - Richard forth
vim brownbag - Richard forth
 
Gpgpu intro
Gpgpu introGpgpu intro
Gpgpu intro
 
How can I get more involved with OpenStack?
How can I get more involved with OpenStack?How can I get more involved with OpenStack?
How can I get more involved with OpenStack?
 
Visibility - the name of the game
Visibility - the name of the gameVisibility - the name of the game
Visibility - the name of the game
 
Rasmus, Think Again! Agile Framework == Happy Php Developer
Rasmus, Think Again! Agile Framework == Happy Php DeveloperRasmus, Think Again! Agile Framework == Happy Php Developer
Rasmus, Think Again! Agile Framework == Happy Php Developer
 
EhTrace -- RoP Hooks
EhTrace -- RoP HooksEhTrace -- RoP Hooks
EhTrace -- RoP Hooks
 
Data Science
Data Science Data Science
Data Science
 
Lec1cgu13updated.ppt
Lec1cgu13updated.pptLec1cgu13updated.ppt
Lec1cgu13updated.ppt
 
Data science programming .ppt
Data science programming .pptData science programming .ppt
Data science programming .ppt
 
Lec1cgu13updated.ppt
Lec1cgu13updated.pptLec1cgu13updated.ppt
Lec1cgu13updated.ppt
 
Lec1cgu13updated.ppt
Lec1cgu13updated.pptLec1cgu13updated.ppt
Lec1cgu13updated.ppt
 
Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1
 

Kürzlich hochgeladen

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Kürzlich hochgeladen (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

ChessFidget - You call that chess?

  • 2. The itch • Like to play chess • Dislike losing so much • Too much work to get good - (For me it would be a dangerous rabbit hole.) 2
  • 3. The scratch • Write software to address personal shortcomings • ChessFidget: a chess app I (currently) always beat 3
  • 4. Currently looks like this In lieu of a demo, I'll post code and (Mac) binaries 4
  • 5. Dev goals/guidelines • Design for dopamine, not skill - E.g. no move history • Computer mostly plays worse chess than I do - Currently random moves - That will get boring; see above re: dopamine • META: Exercise in Swift and reasoning about code - NOT an exercise in chess programming or AI 5
  • 6. 😬:Agonizing re: modeling • What are my objects? (Board, Piece, Move, ...) • In how many places do "business rules" live? - E.g. MoveValidator and MoveGenerator - OTOH, might help with mutual unit-testing • Sometimes the problem was a Swift difficulty - Extending Grid<T>, T is Piece? vs. T is Bool • Sometimes the answer was a Swift feature - Type constraints? 6
  • 7. "Move" as struct+moveType enum MoveType { case resignation case plainMove case pawnTwoSquares case captureEnPassant case pawnPromotion(type: PromotionType) case castleKingSide case castleQueenSide } struct Move { let start: Square let end: Square let type: MoveType } 7
  • 8. Works fine awaitingHumanMove Invalid move e1-g1: cannotCastleBecauseKingOrRookHasMoved d1-d2 (plainMove) played by White (Human) awaitingComputerMove b8-d7 (plainMove) played by Black (Computer) awaitingHumanMove e1-c1 (castleQueenSide) played by White (Human) awaitingComputerMove d7-b6 (plainMove) played by Black (Computer) awaitingHumanMove 8
  • 9. "Move" as class hierarchy protocol MoveProtocol { func updateBoard(_ board: Board) } /* The classes would be something like: Move: MoveProtocol Resignation MoveWithStart PawnTwoSquares CastleKingSide CastleQueenSide MoveWithStartAndEnd PlainMove CaptureEnPassant PawnPromotion */ 9
  • 10. 😬:Swift overwhelm • Building my mental model, esp. re: type system • Finally past the squirmy phase! 😬➞😊 - New info now gets added to mental framework • Maybe pairing would have helped? 10
  • 11. Thoughts about learning • Know thy brain - Came to terms with my jumpy learning - Shlemiel the painter (stay tuned for blog post) • Be aware when/how reach out to people 11
  • 12. Other thoughts • Wow do I suck at chess • Does writing this app mean I'm a bully at heart? • Am I weird for sensing uncanny illusion of intent? - Feels like it's capturing back "on purpose" - Feels intentional when it checks me - This despite knowing there is *zero* AI - WTF it played Fool's Mate 12
  • 13. Actual early test (Computer=Black) (manually recreated; wish I'd taken a screenshot) 13
  • 14. Next (current thinking) • Find a third-party library, add (weak) AI • Distinguish between stalemate and checkmate • Add keyboard input - Might help me learn algebraic notation • Add multi-game play • Move on to other project ideas 14