{"_id":"@asebexen/tacky","_rev":"4-17a9d1090474f9108754b4ca6a47f3c0","name":"@asebexen/tacky","dist-tags":{"latest":"1.1.3"},"versions":{"1.0.0":{"name":"@asebexen/tacky","version":"1.0.0","author":{"name":"Arden Sebexen"},"license":"GPL-3.0-only","_id":"@asebexen/tacky@1.0.0","maintainers":[{"name":"asebexen","email":"ssebexen@gmail.com"}],"homepage":"https://github.com/asebexen/tacky#readme","bugs":{"url":"https://github.com/asebexen/tacky/issues"},"dist":{"shasum":"5e90c51a1580b6987d4f5c85a727c0da5c061808","tarball":"https://registry.npmjs.org/@asebexen/tacky/-/tacky-1.0.0.tgz","fileCount":7,"integrity":"sha512-7Sl7RHrI8oOT3L4UBD8xE9deimOoXUm7UinlPFQtdLYjkGhdoMLkmp3xkFUGLP8XUo6HKlBioRz+F0bOdJ8evg==","signatures":[{"sig":"MEUCIQC/m8bXvCQ1lLhSz4ejjssf8BbEqXlDw6ASDU64nkSWdQIgLE4HyhlydCKG4FitroNnWWLXhh+DoBi4F1EQ6xhcn9k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43504},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"3a7d254716b82b615edb54ddc0c5dfb08f3c9f2a","scripts":{"build":"tsc"},"_npmUser":{"name":"asebexen","email":"ssebexen@gmail.com"},"repository":{"url":"git+https://github.com/asebexen/tacky.git","type":"git"},"_npmVersion":"10.8.2","description":"A simple, functional library for Tic Tac Toe","directories":{},"_nodeVersion":"20.14.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.2"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tacky_1.0.0_1726622761900_0.03725545331854807","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@asebexen/tacky","version":"1.1.0","author":{"name":"Arden Sebexen"},"license":"GPL-3.0-only","_id":"@asebexen/tacky@1.1.0","maintainers":[{"name":"asebexen","email":"ssebexen@gmail.com"}],"homepage":"https://github.com/asebexen/tacky#readme","bugs":{"url":"https://github.com/asebexen/tacky/issues"},"dist":{"shasum":"3ae2eaa01772a8fe60fdd81c35ad440983a95073","tarball":"https://registry.npmjs.org/@asebexen/tacky/-/tacky-1.1.0.tgz","fileCount":5,"integrity":"sha512-jSuOw10QWaUjzGKtZv8pMnnu+03aZbW3n3J1yeF29wThhgqk5DtRb6T0RuYFIztKlOuC7lE36cjbsclhqF9fnA==","signatures":[{"sig":"MEUCIGI6LvoqmCUtea+UbmQQnD59Q72opHbbBlkH2LDrLji/AiEAjojkuRBxkhWAnVk4getPSDGljg24Cf8pYwI9qEWdd7A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":44723},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"1adc687d6a5d322f79ee32ff51fd192e8b8a2998","scripts":{"build":"tsc"},"_npmUser":{"name":"asebexen","email":"ssebexen@gmail.com"},"repository":{"url":"git+https://github.com/asebexen/tacky.git","type":"git"},"_npmVersion":"10.8.2","description":"A simple, functional library for Tic Tac Toe","directories":{},"_nodeVersion":"20.14.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.2"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tacky_1.1.0_1726669286813_0.8312614235710978","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@asebexen/tacky","version":"1.1.1","author":{"name":"Arden Sebexen"},"license":"GPL-3.0-only","_id":"@asebexen/tacky@1.1.1","maintainers":[{"name":"asebexen","email":"ssebexen@gmail.com"}],"homepage":"https://github.com/asebexen/tacky#readme","bugs":{"url":"https://github.com/asebexen/tacky/issues"},"dist":{"shasum":"ff34217802b8d38714a41f325cf33a3ec9c9315a","tarball":"https://registry.npmjs.org/@asebexen/tacky/-/tacky-1.1.1.tgz","fileCount":7,"integrity":"sha512-WUMrvNlEEwtu6910O874MEPN1fC3+8LH4tKXo+HNclImJE10VQN6amdZRgBTNRUS3cWBwBg9r3+tRHO6PB8Bwg==","signatures":[{"sig":"MEUCICyg90W6UpTegU9zH0Lljapj9sgWXMXixfCFO7NZASYoAiEAnOFYy/KSoaYgoCSe+i+zUUsGK2GZ5djfD+xjFuWPL+M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43506},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"468366384779e1b86f909af436a9b87ca5a21d9d","scripts":{"build":"tsc"},"_npmUser":{"name":"asebexen","email":"ssebexen@gmail.com"},"repository":{"url":"git+https://github.com/asebexen/tacky.git","type":"git"},"_npmVersion":"10.8.2","description":"A simple, functional library for Tic Tac Toe","directories":{},"_nodeVersion":"20.14.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.2"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tacky_1.1.1_1726670264599_0.3507727736917776","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"@asebexen/tacky","version":"1.1.2","author":{"name":"Arden Sebexen"},"license":"GPL-3.0-only","_id":"@asebexen/tacky@1.1.2","maintainers":[{"name":"asebexen","email":"ssebexen@gmail.com"}],"homepage":"https://github.com/asebexen/tacky#readme","bugs":{"url":"https://github.com/asebexen/tacky/issues"},"dist":{"shasum":"15a75a14eb96941b132db0630faa2e2b5c7a0be5","tarball":"https://registry.npmjs.org/@asebexen/tacky/-/tacky-1.1.2.tgz","fileCount":7,"integrity":"sha512-yvL1pCWlODP9mMr35D6YeDbXiWRIQNb+ug2TC8az0RUE8TJXIuzkQJJAB5fzwzUM9pmwuMt1VYlIj4Hxj41kPA==","signatures":[{"sig":"MEUCIBnnCepBU3rXPXZI4MCLY7vTLMkWSYz+CZhFyKJEmpd1AiEAtb/xmYCjA+ll2bO+9HRlXB9HRywch5qyhsRhbDOfty8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43619},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"1e688a6194d4901545e0be02993208c9f7d453bc","scripts":{"build":"tsc"},"_npmUser":{"name":"asebexen","email":"ssebexen@gmail.com"},"repository":{"url":"git+https://github.com/asebexen/tacky.git","type":"git"},"_npmVersion":"10.8.2","description":"A simple, functional library for Tic Tac Toe","directories":{},"_nodeVersion":"20.14.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.2"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tacky_1.1.2_1726677123267_0.9457692894367988","host":"s3://npm-registry-packages"}},"1.1.3":{"name":"@asebexen/tacky","version":"1.1.3","description":"A simple, functional library for Tic Tac Toe","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc"},"repository":{"type":"git","url":"git+https://github.com/asebexen/tacky.git"},"author":{"name":"Arden Sebexen"},"license":"GPL-3.0-only","bugs":{"url":"https://github.com/asebexen/tacky/issues"},"homepage":"https://github.com/asebexen/tacky#readme","devDependencies":{"typescript":"^5.6.2"},"peerDependencies":{"typescript":"^5.0.0"},"_id":"@asebexen/tacky@1.1.3","gitHead":"1e688a6194d4901545e0be02993208c9f7d453bc","_nodeVersion":"20.14.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-9KCsyZFFLmUluIznLyD4xm9Cmuvr3SxIhns16EwwldXrEegd5Hs9W43Q/otsrvWBZj9+oE9KuE1Ha83X70cm+Q==","shasum":"630152f95ce2847de6c4bf1fe5b23ef233f77639","tarball":"https://registry.npmjs.org/@asebexen/tacky/-/tacky-1.1.3.tgz","fileCount":7,"unpackedSize":43506,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPlGq8vOyPUhUq70gsRhb2PkmLExOAZIIDxdp8sEQPGAIhAL25Ng0OkmwpOgUhypt7arhV0Efcyhw9Q3mkGkLeVbEV"}]},"_npmUser":{"name":"asebexen","email":"ssebexen@gmail.com"},"directories":{},"maintainers":[{"name":"asebexen","email":"ssebexen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tacky_1.1.3_1726677293841_0.7735896288232182"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-18T01:26:01.737Z","modified":"2024-09-18T16:34:54.243Z","1.0.0":"2024-09-18T01:26:02.095Z","1.1.0":"2024-09-18T14:21:27.047Z","1.1.1":"2024-09-18T14:37:44.747Z","1.1.2":"2024-09-18T16:32:03.556Z","1.1.3":"2024-09-18T16:34:54.070Z"},"bugs":{"url":"https://github.com/asebexen/tacky/issues"},"author":{"name":"Arden Sebexen"},"license":"GPL-3.0-only","homepage":"https://github.com/asebexen/tacky#readme","repository":{"type":"git","url":"git+https://github.com/asebexen/tacky.git"},"description":"A simple, functional library for Tic Tac Toe","maintainers":[{"name":"asebexen","email":"ssebexen@gmail.com"}],"readme":"# About Tacky\nTacky is a lightweight, functional library built to help you (yes, you!) write Tic-Tac-Toe applications!  \nTacky makes it simple to interact with a Tic-Tac-Toe instance without complicated validation logic.  \n## How to Use\nTo include Tacky in your project, install with `npm i @asebexen/tacky`  \nTacky exposes only a few functions, but they're all mega powerful!\n```typescript\nimport * as tacky from '@asebexen/tacky';\n\n// Generate a new, empty game board with an optional config object.\nconst initGame0 = tacky.init();\nconst initGame1 = tacky.init({startingPlayer: 'o'});\n\n// Make a move in the top right square (2). Valid positions are in the range [0, 8].\nconst result0 = tacky.makeMove(initGame0, 2);\n// Tacky guarantees that a valid game is returned, even if there are errors (in which case, the game will be unmodified). Errors are string enums, so they can be printed and understood.\nif (result0.error) console.error(`Tacky error: ${result0.error}`);\nconst game0 = result0.game;\n\n// Make another move, but this time without error handling!\nconst {game: game1} = tacky.makeMove(game0, 1);\n\n// This is boring; let's just skip ahead to a game that X wins already.\nconst winningGame = tacky.fromHistory([2, 1, 4, 0, 6]);\n```\nLet's have a look at the winning game object...\n```json\n{\n  \"game\": {\n    \"board\": [ \"o\", \"o\", \"x\", null, \"x\", null, \"x\", null, null ],\n    \"moveHistory\": [ 2, 1, 4, 0, 6 ],\n    \"startingPlayer\": \"x\",\n    \"currentPlayer\": \"o\",\n    \"state\": \"xwin\",\n    \"winningLine\": [ 2, 4, 6 ]\n  },\n  \"error\": null\n}\n```\nThe beauty of Tacky is that it's meant to be human-readable and friendly. I don't even think I have to explain the object above!  \nBy gracefully reporting errors in the `error` field, Tacky is flexible and unopinionated; it can be attached to any kind of frontend, and errors can be ignored or reported as desired!\n## Features\n- Full TypeScript support. I like types, you like types!\n- Functional design, supporting immutability. Tryna make this crap work nicely with React and stuff.\n- Automatic turn tracking. Why use mutable variables when it could be part of the game state?\n- No-throw error handling for the following:\n  - Out-of-bounds positions. While I applaud thinking outside the box, my game (sadly) does not.\n  - Placing tiles in occupied cells. Preventing cheating is another way I stop you from having real fun.\n  - Continuing to play after the game is over.\n- History tracking. Everyone wants to relive that Play of the Game moment, right?\n- Winning line provided free of charge. I get it, Tic Tac Toe is complex. You probably want a way to figure out how exactly X won instead of O.\n## Planned Features\n- Minimax tree support. I know you wanna know the optimal way to crush your opponents. (Hint: YOU CAN'T. Unless they're stupid. No offense.)\n- Alternate ruleset support. Because normal Tic Tac Toe is boring. No offense.\n- More robust input validation. Because some ~~JavaScript user~~ human being is gonna try to pass a boolean into my beautifully-typed functions and they're gonna BREAK IT and I'm gonna CRY.\n## Bonus Features\n- I told Cursor to use Tacky to write a sample Tic Tac Toe game and it did. It's so easy, even an AI can use it. uwu\n## License\nTacky is licensed under the GNU GPLv3. If this is a royal pain in your arse, write to me and we can work it out. :3\n## Contact\nEmail all inquiries to asebexen@gmail.com  \nIf you used Tacky in a project, feel free to let me know! I'd actually be quite flattered to hear from you lmao.","readmeFilename":"README.md"}