From c35d5ead81dc92621ff1d7d5104fda8346c74d73 Mon Sep 17 00:00:00 2001 From: elioat <{ID}+{username}@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:00:33 -0500 Subject: * --- rust/bf/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rust/bf/src') diff --git a/rust/bf/src/main.rs b/rust/bf/src/main.rs index 9257ae2..e511e69 100644 --- a/rust/bf/src/main.rs +++ b/rust/bf/src/main.rs @@ -16,12 +16,12 @@ fn interpret_brainfuck(code: &str) { '>' => { pointer += 1; if pointer >= memory.len() { - panic!("Pointer out of bounds"); + panic!("Pointer out of bounds (positive)"); } } '<' => { if pointer == 0 { - panic!("Pointer out of bounds"); + panic!("Pointer out of bounds (negative)"); } pointer -= 1; } @@ -36,7 +36,7 @@ fn interpret_brainfuck(code: &str) { } ',' => { let mut input = [0u8]; - io::stdin().read_exact(&mut input).expect("Failed to read input"); + io::stdin().read_exact(&mut input).expect("Failed to read input. Unable to read a single byte from stdin"); memory[pointer] = input[0]; } '[' => { -- cgit 1.4.1-2-gfad0 gnore?id=764c606cd82ce02b6285f947231a6493d7dc2674'>commit diff stats
path: root/.gitignore
blob: 629e12969a8176ecf63a6765c91930b2c0a1653f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94