[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-682315-105":59,"doc-detail-682315-en":130,"doc-similar-682315":158},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","programming-a-chess-ai-master-thesis-report-mocksh","Programming a Chess AI - Master thesis report - Mocksh","","Report on programming a chess AI, motivated by the rise of chess engines after Deep Blue’s 1997 victory and the later breakthroughs by AlphaZero and neural-network engines. The work contrasts neural-network approaches with classical engine techniques and then explains the author’s Stockfish-like development path. It documents iterative versions of the engine “Mocksh” from 0.1 through 2.1, detailing improvements in board representation, move generation, search trees, heuristic evaluation, minimax, alpha-beta pruning, and performance enhancements via move ordering and multithreading.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":40,"@type":76,"position":81},"https://docshare.wps.com/document/research-report/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/programming-a-chess-ai-master-thesis-report-mocksh/682315/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/programming-a-chess-ai-master-thesis-report-mocksh/682315.png","ImageObject",300,407,{"name":92,"@type":93},"naya.afterrain","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-17","2026-11-06",true,{"@type":102,"interactionType":103,"userInteractionCount":81},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What is the main goal of the report on a chess AI?","Question",{"text":112,"@type":113},"The report asks whether the author can program a chess AI that can defeat the author as a human player.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"Why does the author choose a Stockfish-like approach instead of neural networks?",{"text":117,"@type":113},"The author explains that coding a neural network would exceed the scope of the thesis, while classical engine algorithms allow the development focus to stay within the project.",{"name":119,"@type":110,"acceptedAnswer":120},"What improvements make Mocksh faster after version 2.0?",{"text":121,"@type":113},"Mocksh 2.1 reduces computation time by sorting the search tree, evaluating in multiple threads, and directly connecting tree expansion with the pruning algorithm.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},682315,1793965908,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":81,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":129,"read_time":144,"preview_page_count":81,"preview_urls":145},962094248482,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","Kantonsschule Hohe Promenade, Gymnasium, Z􀁿urich Schuljahr 2019/2020  \nProgramming a Chess AI  \nOliver Graf, Klasse 6e  \nBetreuende Lehrperson: Clemens Pohle Korreferent: Stefan M􀁿uller  \nContents  \n1 Introduction 1  \n1.1 My question ............................... 1  \n1.2 Prerequisites for understanding this report .............. 1  \n2 The work process 2  \n2.1 May and June 2019: Mock􀀌sh 0.1 ................... 2  \n2.2 July and August 2019: Mock􀀌sh 1.0 .................. 2  \n2.3 September 2019: Mock􀀌sh 2.0 ..................... 2  \n2.4 After September 2019: Mock􀀌sh 2.1 .................. 2  \n3 How does a chess AI work? 3  \n3.1 Board representation .......................... 3  \n3.1.1 Mock􀀌sh 0.1 ........................... 3  \n3.1.2 Mock􀀌sh 1.0 ........................... 4  \n3.1.3 Mock􀀌sh 2.0 ........................... 5  \n3.1.4 Square representation ...................... 6  \n3.2 Move generation ............................. 7  \n3.3 Search tree ................................ 8  \n3.4 Heuristic Evaluation .......................... 9  \n3.4.1 The pawn in the endgame ................... 10  \n3.4.2 The knight in the opening ................... 11  \n3.5 Minimax ................................. 12  \n3.6 􀀋{􀀌 pruning ............................... 13  \n3.7 Improvements upon standard 􀀋{􀀌 ................... 18  \n3.7.1 Sorting .............................. 18  \n3.7.2 Multithreading ......................... 19  \n4 Conclusion 21  \n4.1 Statistical remarks ........................... 21  \n4.2 Personal remarks ............................ 21  \n5 Sources 22  \n1 Introduction  \nWhen Deep Blue defeated the acting chess world champion Garry Kasparov in 1997, chess AIs became central to the chess world. Unbeatable for human players, they strongly in􀀍uence the playing style of chess masters today and they are still being developed: every year, the best chess engine is determined at the TCEC (Top Chess Engine Championship) . Last year, an interesting development occurred: for the 􀀌rst time, a chess engine based on neural network technology | Leela Chess Zero | won the TCEC while Stock􀀌sh, the winner of the last few years, only ranked second (Monokroussos, 2019) .  \nA few months before, Google Deepmind's AlphaZero | also a neural network AI | had already defeated Stock􀀌sh, though in arguably unfair conditions (DeepMind and University College London, 2018) . Since then, I've always asked myself how chess engines work and how hard it would be to code one myself.  \nThere are two approaches to coding chess AIs: using neural networks like AlphaZero or with algorithms that already existed in the 􀀌fties | like Stock􀀌sh or Komodo. These algorithms make use of search trees, 􀀋{􀀌 pruning and heuristic evaluation algorithms. I decided to code a chess AI using the Stock􀀌sh-like approach because coding a neural network certainly would have blown the frame of a matura thesis.  \nAs an hommage to Stock􀀌sh, I baptized my own chess engine Mock􀀌sh.  \n1.1 My question  \nAm I capable of programming a chess AI that can defeat me as a human player?  \n1.2 Prerequisites for understanding this report  \nTo understand every part of this report, you only have to know the chess rules (including en passant captures, pawn promotion and castling) as well as a fundamental understanding of programming. This includes arrays, functions and object-oriented programming.  \n2 The work process  \n2.1 May and June 2019: Mock􀀌sh 0.1  \nI started using the name Mock􀀌sh starting with the second version of my chess engine, so this version is called 0 . 1 instead of 1 .0. It included an advanced GUI and though it was possible to play a real game against it, it still was very ine􀀎cient: since I hadn't separated the frontend (graphics) from the backend (position evaluation), this version has severe performance issues that I couldn't get rid of without totally rewriting the application.  \n2.2 July and August 2019: Mock􀀌sh 1.0  \nThe second version didn't use more advanced chess programming theory ","cbCaivrdS8JZAKcU","https://ap.wps.com/l/cbCaivrdS8JZAKcU","pdf",344020,26,"English","# Introduction\n## My question\n## Prerequisites for understanding this report\n# The work process\n## May and June 2019: Mocksh 0.1\n## July and August 2019: Mocksh 1.0\n## September 2019: Mocksh 2.0\n## After September 2019: Mocksh 2.1\n# How does a chess AI work?\n## Board representation\n## Move generation\n## Search tree\n## Heuristic Evaluation\n## Minimax\n## Alpha-beta pruning\n## Improvements upon standard\n# Conclusion\n## Statistical remarks\n## Personal remarks\n# Sources","[{\"question\":\"What is the main goal of the report on a chess AI?\",\"answer\":\"The report asks whether the author can program a chess AI that can defeat the author as a human player.\"},{\"question\":\"Why does the author choose a Stockfish-like approach instead of neural networks?\",\"answer\":\"The author explains that coding a neural network would exceed the scope of the thesis, while classical engine algorithms allow the development focus to stay within the project.\"},{\"question\":\"What improvements make Mocksh faster after version 2.0?\",\"answer\":\"Mocksh 2.1 reduces computation time by sorting the search tree, evaluating in multiple threads, and directly connecting tree expansion with the pruning algorithm.\"}]","Programming a Chess AI - Master thesis report - Mocksh | PDF",66,[146,150,154],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/bf0e805bf30d650fd326e8448f5fb948.webp",983,1390,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/7e42e980126de81af4b81762727b0681.webp",982,1388,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/60123242aba11f48893379fb362cf61b.webp",981,1387,{"list":159,"token":66},[160,166,173,180,187,193,200,206,212,217],{"doc_id":161,"doc_title":162,"file_type":137,"home_preview_img_url":163,"slug":164,"view_count":24,"category_name":40,"create_tm":165},681867,"Estimating Chess Puzzle Difficulty Without Past Game Records Using a Human Problem-Solving Inspired Neural Network Architecture","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999250653/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109599&Signature=PJlp96TwGCpoO%2FRciEXAxdn0ndg%3D","estimating-chess-puzzle-difficulty-without-past-game-records-using-a-human-problem-solving-inspired-neural-network-architecture",1793955692,{"doc_id":167,"doc_title":168,"file_type":137,"home_preview_img_url":169,"slug":170,"view_count":171,"category_name":40,"create_tm":172},86241,"Communicating Chess Strategies in Natural Language","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809513503/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109599&Signature=jhd7v7pCO6lZhxY4UMhDniwwpYc%3D","communicating-chess-strategies-in-natural-language",25,1784209736,{"doc_id":174,"doc_title":175,"file_type":137,"home_preview_img_url":176,"slug":177,"view_count":178,"category_name":40,"create_tm":179},126947,"REAL TIME TRACKING AND ANALYSIS OF PHYSICAL CHESS GAMES USING COMPUTER VISION AND MACHINE LEARNING","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229839513424/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109599&Signature=njMfJ%2F3rn%2Fh4aZBv2YYYhAn4QHQ%3D","real-time-tracking-and-analysis-of-physical-chess-games-using-computer-vision-and-machine-learning",15,1785935838,{"doc_id":181,"doc_title":182,"file_type":137,"home_preview_img_url":183,"slug":184,"view_count":185,"category_name":40,"create_tm":186},85408,"Hyperflux Pruning Reveals Importance","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809265188/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109599&Signature=HsBVgHGCQVB3SGd0KaLvViy7QTg%3D","hyperflux-pruning-reveals-importance",24,1784203191,{"doc_id":188,"doc_title":189,"file_type":137,"home_preview_img_url":190,"slug":191,"view_count":19,"category_name":40,"create_tm":192},671856,"Learning to Plan via Supervised Contrastive Learning and Strategic Interpolation - A Chess Case Study","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988785889/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109599&Signature=DkGHqvOqWuxj4x7U5zDnjqlOnWM%3D","learning-to-plan-via-supervised-contrastive-learning-and-strategic-interpolation-a-chess-case-study",1793581662,{"doc_id":194,"doc_title":195,"file_type":137,"home_preview_img_url":196,"slug":197,"view_count":198,"category_name":40,"create_tm":199},118866,"Fair Compression of Machine Learning Vision Systems - Thesis Abstract","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229834987259/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109599&Signature=BDtNAP1rL4EfDoz2LxFgGeT2%2FzY%3D","fair-compression-of-machine-learning-vision-systems-thesis-abstract",23,1785720690,{"doc_id":201,"doc_title":202,"file_type":137,"home_preview_img_url":203,"slug":204,"view_count":29,"category_name":40,"create_tm":205},492192,"Neural Networks - Study Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229928570405/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109599&Signature=a%2BP1GbVvJ5aJuYcmg2PVdtOpbX4%3D","neural-networks-study-guide",1790859537,{"doc_id":207,"doc_title":208,"file_type":137,"home_preview_img_url":209,"slug":210,"view_count":81,"category_name":40,"create_tm":211},687342,"Slimmable Pruned Neural Networks - Abstract","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001258249/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109599&Signature=trdoGQmcZL0RZ5JGLD3nxsM0Phc%3D","slimmable-pruned-neural-networks-abstract",1794083027,{"doc_id":213,"doc_title":168,"file_type":137,"home_preview_img_url":214,"slug":215,"view_count":81,"category_name":40,"create_tm":216},681864,"https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999250412/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109599&Signature=SWANdHotoJKE8kYM5k0rRYOTN2M%3D","communicating-chess-strategies-in-natural-language-681864",1793955676,{"doc_id":218,"doc_title":219,"file_type":137,"home_preview_img_url":220,"slug":221,"view_count":81,"category_name":40,"create_tm":222},684209,"Chess variation entropy and engine relevance for humans","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000057382/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109599&Signature=tEBBkU296a%2Bsm8qUR3gO3fjd4AA%3D","chess-variation-entropy-and-engine-relevance-for-humans",1794004010]