Read character
(&self)
| 27 | |
| 28 | // Read character |
| 29 | pub fn readchar(&self) -> Option<char> |
| 30 | { |
| 31 | let mut buffer = vec![0; 4]; |
| 32 | if let Some(bytes) = crate::sys::sc::read(0, &mut buffer) |
| 33 | { |
| 34 | if bytes > 0 |
| 35 | { |
| 36 | buffer.resize(bytes, 0); |
| 37 | return Some(String::from_utf8_lossy(&buffer).to_string().remove(0)); |
| 38 | } |
| 39 | } |
| 40 | None |
| 41 | } |
| 42 | |
| 43 | |
| 44 | // Read line |