{"id":24789474,"url":"https://github.com/fr4nc3/csharp_tictactoe_api","last_synced_at":"2025-08-12T18:07:14.768Z","repository":{"id":148056745,"uuid":"384158876","full_name":"Fr4nc3/csharp_tictactoe_api","owner":"Fr4nc3","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-12T18:16:58.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T18:19:25.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fr4nc3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-08T14:51:37.000Z","updated_at":"2021-07-12T18:17:01.000Z","dependencies_parsed_at":"2023-05-28T07:45:27.026Z","dependency_job_id":null,"html_url":"https://github.com/Fr4nc3/csharp_tictactoe_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Fr4nc3/csharp_tictactoe_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fr4nc3%2Fcsharp_tictactoe_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fr4nc3%2Fcsharp_tictactoe_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fr4nc3%2Fcsharp_tictactoe_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fr4nc3%2Fcsharp_tictactoe_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fr4nc3","download_url":"https://codeload.github.com/Fr4nc3/csharp_tictactoe_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fr4nc3%2Fcsharp_tictactoe_api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270109377,"owners_count":24528789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-29T17:18:08.984Z","updated_at":"2025-08-12T18:07:14.749Z","avatar_url":"https://github.com/Fr4nc3.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fr4nc3.com.tictactoe\n\nopen project and build no error or warning\n\n## Rest api\n\n- GameMove model\n- GameMoveResponse model\n- Validation using Annotations\n- Models have internal fields used to validate Model\n  Aditional rules\n- if gameboard comes full of '?' ignore move variable and Azure play first\n- human move integer shall came filled in the gameboard too\n  ie: move 1, human =X board = [\"O\", \"X\", \"O\", \"X\", \"?\", \"X\", \"X\", \"O\", \"O\"]\n- swagger enabled by class example version 2.0\n- rest api has one controller\n- tictactoeController\n- two method\n- executemove\n- calulatemove\n- RestClientSDKLibrary\n- implemented by class example\n- I noticed that the annottations created a validation function on GameMove and SelfMove\n- I disable these validation\n- ie. commented line 438 fr4nc3.com.tictactoe\\RestClientSDKLibrary\\RestClientSDKLibraryClient\\RestClientSDKLibraryClient.cs\n- I noticed the Body for 400 error expected on RestClientSDKLibrary was int? I converted to object\n  ie. file fr4nc3.com.tictactoe\\RestClientSDKLibrary\\RestClientSDKLibraryClient\\RestClientSDKLibraryClient.cs\n  from\n  \\_result.Body = SafeJsonConvert.DeserializeObject\u003cint\u003e(\\_responseContent, this.DeserializationSettings);\n  to\n  \\_result.Body = SafeJsonConvert.DeserializeObject\u003cobject\u003e(\\_responseContent, this.DeserializationSettings);\n\n### Self play\n\n- I was able to write calculatemove gameboard\n- to follow these rules\n- take player symbol and random get an available position\n- check if there is a winner and return the results\n- this version only move one player symbol at the time\n- it has the same validation annotation that GameMove\n- in the MSTest to play I created a loop that switch between X and O player to request next movement\n- from the HW example, I was not clear if after the player symbol moves the other player also moves.\n- I mean, It can be two movements per request, but I decided one move per request, and the player need to be changing by request.\n\n### MSTest\n\n- MSTest for calculatemove\n- single game\n- 100 games in a loop with results\n  ie.\n  winnerX: 48\n  winnerO: 36\n  winnerTie: 16\n\n- executemove MStest 20 test for differents constrains and restriction for the game in the code\n- calulatemove MStest 8 test for differents constrains and restriction for the game in the code and a self play and 100 time self play\n\n### References\n\nhttps://medium.com/c-sharp-progarmming/xml-comments-swagger-net-core-a390942d3329\n\nhttps://docs.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-5.0\u0026tabs=visual-studio\n\nhttps://docs.microsoft.com/en-us/aspnet/core/tutorials/web-api-help-pages-using-swagger?view=aspnetcore-5.0\n\nhttps://docs.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-5.0\u0026tabs=visual-studio\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffr4nc3%2Fcsharp_tictactoe_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffr4nc3%2Fcsharp_tictactoe_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffr4nc3%2Fcsharp_tictactoe_api/lists"}