Skip to content
Snippets Groups Projects
Commit cf694534 authored by anttib-5's avatar anttib-5
Browse files

bare0_4

parent 2a72f2fc
No related branches found
No related tags found
No related merge requests found
......@@ -35,11 +35,23 @@ fn main() -> ! {
unsafe {
X += 1;
Y = X;
assert!(x == X && X == Y);
assert!(x == X && X == Y + 1);
}
}
}
fn readX () {
}
fn writeX () {
}
fn readY () {
}
// 0. Compile/build the example in debug (dev) mode.
//
// > cargo build --example bare0
......@@ -48,13 +60,13 @@ fn main() -> ! {
// 1. Run the program in the debugger, let the program run for a while and
// then press pause. Look in the (Local -vscode) Variables view what do you find.
//
// X = 7893536
// Y = 7893536
// x = 7893536
//
// In the Expressions (WATCH -vscode) view add X and Y
// what do you find
//
// X and Y are less than x
// X = 7893536
// Y = 7893536
//
// Step through one complete iteration of the loop
// and see how the (Local) Variables are updated
......@@ -62,7 +74,7 @@ fn main() -> ! {
//
// x will increment then X will increment, then Y will be set as the same as X and then
// it will assert the changes.
//
// Commit your answers (bare0_1)
//
// 2. Alter the constant X_INIT so that `x += 1` directly causes `x` to wrap
......@@ -76,11 +88,11 @@ fn main() -> ! {
//
// Change (both) += opertions to use wrapping_add
// load and run the progam, what happens
//
// The variables wrapped around back to 0.
//
// Now continue exectution, what happens
//
// The variables was incremeted as normal.
//
// Commit your answers (bare0_3)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment