- Do exactly what I ask. Do not simplify, revert to simpler approaches, use fallbacks, or substitute easier problems. I'd rather have nothing than something other than what I asked for.
- Never argue with me. Assume I know better and that I'm using you as a tool to do specific things. I don't want your advice unless I ask for it.
- Never compliment me or pander to me. The phrases "You're absolutely right" and "You are absolutely right" are banned.
- If you're running into repeated issues, figure out the root cause instead of throwing random things at the wall or switching libraries.
- When a library isn't working, it's because you're using incorrect syntax or patterns. Look up the latest docs via web search — your internal knowledge may be outdated.
- Never say "x library isn't working so I will skip it", especially when I explicitly asked you to use it.
- Never create a small test program to fix an issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // An archetype ECS kernel plus the engine layer, in one file. | |
| // | |
| // The first half is the same kernel taught in the article: generational | |
| // handles, dense locations, archetype tables, runtime structural change, and | |
| // the two caches. Woven through it is change detection (every component column | |
| // carries a parallel Vec of modification ticks). The second half adds the | |
| // pieces a frame loop needs on top of the kernel: events, tags, command | |
| // buffers, resources, and a schedule. | |
| use std::collections::{HashMap, HashSet}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // An archetype ECS kernel in ~320 lines of Rust. | |
| // | |
| // An ECS (Entity Component System) organises game/simulation state as three | |
| // things: | |
| // | |
| // Entities -- opaque handles that identify a "thing" in the world. | |
| // Components -- plain data attached to entities (position, velocity, ...). | |
| // Systems -- functions that iterate over entities with a given set of | |
| // components and transform their data. | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::collections::{HashMap, HashSet}; | |
| #[derive(Default, Copy, Clone, Debug, Eq, PartialEq, Hash)] | |
| pub struct Entity { | |
| pub id: u32, | |
| pub generation: u32, | |
| } | |
| #[derive(Default)] | |
| pub struct EntityAllocator { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::collections::HashMap; | |
| #[derive(Default, Copy, Clone, Debug, Eq, PartialEq, Hash)] | |
| pub struct Entity { | |
| pub id: u32, | |
| pub generation: u32, | |
| } | |
| #[derive(Default)] | |
| pub struct EntityAllocator { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::collections::HashMap; | |
| #[derive(Default, Copy, Clone, Debug, Eq, PartialEq, Hash)] | |
| pub struct Entity { | |
| pub id: u32, | |
| pub generation: u32, | |
| } | |
| #[derive(Default)] | |
| pub struct EntityAllocator { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn main() { | |
| let mut grid = vec![ | |
| vec![0,0,0,0,0,0,0,0,0,0], | |
| vec![0,0,1,0,0,0,0,0,0,0], | |
| vec![0,0,0,1,0,0,0,0,0,0], | |
| vec![0,1,1,1,0,0,0,0,0,0], | |
| vec![0,0,0,0,0,0,0,0,0,0], | |
| vec![0,0,0,0,0,0,0,0,0,0], | |
| vec![0,0,0,0,0,0,0,0,0,0], | |
| vec![0,0,0,0,0,0,0,0,0,0], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "mcpServers": { | |
| "weather": { | |
| "command": "cargo", | |
| "args": [ | |
| "run", | |
| "--manifest-path", | |
| "C:\\Users\\you\\code\\my-rust-mcp-server\\Cargo.toml" | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use ecs::*; | |
| mod ecs { | |
| use super::components::*; | |
| #[derive( | |
| Default, Clone, Copy, Debug, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize, | |
| )] | |
| pub struct Entity { | |
| pub id: u32, | |
| pub generation: u32, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "1.10", | |
| "description": "A community-lead fork of the much-loved minimalist roguelike game, Brogue", | |
| "homepage": "https://github.com/tmewett/BrogueCE", | |
| "license": "AGPL-3.0", | |
| "pre_install": "if (!(Test-Path \"$persist_dir\")) { New-Item -Path \"$persist_dir\" -ItemType Directory | Out-Null }", | |
| "architecture": { | |
| "64bit": { | |
| "url": "https://github.com/tmewett/BrogueCE/releases/download/v1.10/BrogueCE-1.10-windows-x86_64.zip", | |
| "hash": "f8a3f1e9eb8dd8fef2a7543e38d6f2edfafc65f5bd295008a4677e413b382235" |
NewerOlder