INDAPlus21 / INDAPlus21/emilhul-assembly

Pass

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

**Very well done Emil!**

_Same feedback as Felix._

Your code looks overall good. However, there are instances of repeating code patterns. Are these douplications necessary? For example:
_Your code:_
```rust
OperationType::INCREMENT => {
let mut selected_registries: (i32, i32);
if prefix_type == PrefixType::POLITE || prefix_type == PrefixType::POLITE_STRONG {
selected_registries = polite_registries;
} else {
selected_registries = demanding_registries;
}

//...

if specifics[0] {
selected_registries.1 = selected_registry;
} else {
selected_registries.0 = selected_registry;
}

if prefix_type == PrefixType::POLITE || prefix_type == PrefixType::POLITE_STRONG {
polite_registries = selected_registries;
} else {
demanding_registries = selected_registries;
}
},
OperationType::TO => {
let mut selected_registries: (i32, i32);
if prefix_type == PrefixType::POLITE || prefix_type == PrefixType::POLITE_STRONG {
selected_registries = polite_registries;
} else {
selected_registries = demanding_registries;
}

//...

if specifics[0] {
selected_registries.1 = selected_registry;
} else {
selected_registries.0 = selected_registry;
}

if prefix_type == PrefixType::POLITE || prefix_type == PrefixType::POLITE_STRONG {
polite_registries = selected_registries;
} else {
demanding_registries = selected_registries;
}
}
OperationType::ACCESS => {
let mut selected_registries: (i32, i32);
if prefix_type == PrefixType::POLITE || prefix_type == PrefixType::POLITE_STRONG {
selected_registries = polite_registries;
} else {
selected_registries = demanding_registries;
}

//...

if specifics[0] {
selected_registries.1 = selected_registry;
} else {
selected_registries.0 = selected_registry;
}

if prefix_type == PrefixType::POLITE || prefix_type == PrefixType::POLITE_STRONG {
polite_registries = selected_registries;
} else {
demanding_registries = selected_registries;
}
}
```

**Note**: I failed to run your code on my machine. But since I think I remember seeing you present it live, you'll pass.

Thanks for the hard work!

Can be found in Datas Sångbok:
```
When I find my code in tons of trouble,
Friends and colleagues come to me,
Speaking words of wisdom:
"Write in C."

As the deadline fast approaches,
And bugs are all that I can see,
Somewhere, someone whispers"
"Write in C."

Write in C, write in C,
Write in C, write in C.
LISP is dead and buried,
Write in C.

I used to write a lot of FORTRAN,
for science it worked flawlessly.
Try using it for graphics!
Write in C.

If you've just spent nearly 30 hours
Debugging some assembly,
Soon you will be glad to
Write in C.

Write in C, write in C,
Write In C, yeah, write in C.
Only wimps use BASIC.
Write in C.

Write in C, write in C,
Write in C, oh, write in C.
Pascal won't quite cut it.
Write in C.

Guitar Solo

Write in C, write in C,
Write in C, yeah, write in C.
Don't even mention COBOL.
Write in C.

And when the screen is fuzzy,
And the edior is bugging me.
I'm sick of ones and zeroes.
Write in C.

A thousand people people swear that T.P.
Seven is the one for me.
I hate the word PROCEDURE,
Write in C.

Write in C, write in C,
Write in C, yeah, write in C.
PL1 is 80's,
Write in C.

Write in C, write in C,
Write in C, yeah, write in C.
The government loves ADA,
Write in C.
```

Contributor guide

No contributing guide indexed for this repository

Research direction

No file or test is named. Locate the Rust match containing the OperationType::INCREMENT, TO, and ACCESS arms, then compare their repeated registry-selection and update logic. Done means the duplication is reduced without changing the behavior of those operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.