Notice
Recent Posts
Recent Comments
목록BF (1)
NeuroWhAI의 잡블로그
[Rust] Brainfuck(브레인퍽) 구현
use std::io::{self, Read}; mod bf { use std::io::{self, Read}; #[derive(Default)] pub struct Machine { code: Vec, ram: Vec, head: usize, ptr: usize, } impl Machine { pub fn new() -> Self { Machine::default() } } impl Machine { pub fn initialize(&mut self, ram_size: usize) { self.ram.resize(ram_size, 0); } pub fn mount(&mut self, code: &str) { self.code = code.chars().collect(); } pub fn step(&mu..
개발 및 공부
2019. 1. 15. 21:15