Simple text example

This commit is contained in:
2025-10-28 21:17:39 +01:00
parent b1b0a78aad
commit 4ae0189356
3 changed files with 41 additions and 8 deletions
+7 -8
View File
@@ -2,21 +2,20 @@ mod binary;
mod emulator;
mod text;
use std::sync::Arc;
use std::{fs, sync::Arc};
use osui::prelude::*;
use crate::emulator::{instruction::Instruction, registry::Registry};
use crate::{
emulator::{instruction::Instruction, registry::Registry},
text::from_text,
};
fn main() {
let screen = Screen::new();
let instructions = vec![
Instruction::REG(0, 6),
Instruction::REG(1, 7),
Instruction::ADD(0, 1, 2), // 6 + 7
];
let s = fs::read_to_string("input.fg").unwrap();
app(&screen, instructions).draw(&screen);
app(&screen, from_text(&s)).draw(&screen);
screen.run().unwrap();
}