Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more exercises to MIPS track #13

Open
mpriestman opened this issue Aug 30, 2016 · 7 comments
Open

Add more exercises to MIPS track #13

mpriestman opened this issue Aug 30, 2016 · 7 comments

Comments

@mpriestman
Copy link
Contributor

Issue to just discuss possible problems that could be added to the MIPS track. Looking down the list of available ones from other languages (http://exercism.io/languages/mips/contribute), a lot seem just too hard for assembly (a lot involve string or data structure manipulation). However, I think there are still some that could make the transition to assembly. The following could be good candidates:

  • difference-of-squares - seems pretty straightforward, single integer input, single integer output.
  • nucleotide-count - simple input, but needs to return 4 integer values. Could use hi and lo parts of v0 and v1?
  • atbash-cipher - single string input, fixed size string output.
  • luhn - could make for an interesting challenge, string input, boolean result.
  • pangram - pretty similar to the isogram problem.
  • binary-search - could be fun too.

Could also try to come up with some new exercises just for the MIPS track that are more "assembly-like".

Any thoughts?

@ozan
Copy link
Contributor

ozan commented Aug 31, 2016

Hey there! These are great choices. I agree that many of the standard
exercise problems involve a lot of branchy string manipulation work or
require libraries for functionality like Georgian dates. After implementing
these it may make sense to add new problems that suit lower level
programming. For instance we could add some of the exercises from K&R C.

Regarding nucleotide count, your strategy would be fine, or the caller
could just specify a memory location at which it expects the callee to
write four ints. If we maxed each count out at 256 we could even cram it
all into one register :)

On Tuesday, August 30, 2016, mpriestman [email protected] wrote:

Issue to just discuss possible problems that could be added to the MIPS
track. Looking down the list of available ones from other languages (
http://exercism.io/languages/mips/contribute), a lot seem just too hard
for assembly (a lot involve string or data structure manipulation).
However, I think there are still some that could make the transition to
assembly. The following could be good candidates:

  • difference-of-squares - seems pretty straightforward, single integer
    input, single integer output.
  • nucleotide-count - simple input, but needs to return 4 integer
    values. Could use hi and lo parts of v0 and v1?
  • atbash-cipher - single string input, fixed size string output.
  • luhn - could make for an interesting challenge, string input,
    boolean result.
  • pangram - pretty similar to the isogram problem.
  • binary-search - could be fun too.

Could also try to come up with some new exercises just for the MIPS track
that are more "assembly-like".

Any thoughts?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#13, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAG6z-Ldh956TKCwD--x-3TU79YuqKRMks5qlLOvgaJpZM4JxDzm
.

@ozan
Copy link
Contributor

ozan commented Aug 31, 2016

Another interesting problem is bracket push. This appears to be a hard
problem to solve in any language, until the student decides to use a stack,
at which point it would be straightforward even in asm. Similarly once the
student knows how to implement a circular buffer or deque, a problem that
requires breadth first traversal is just as approachable in asm as in a
high level language. Something like the bucket problem could be a good
example.

On Wednesday, August 31, 2016, Ozan Onay [email protected] wrote:

Hey there! These are great choices. I agree that many of the standard
exercise problems involve a lot of branchy string manipulation work or
require libraries for functionality like Georgian dates. After implementing
these it may make sense to add new problems that suit lower level
programming. For instance we could add some of the exercises from K&R C.

Regarding nucleotide count, your strategy would be fine, or the caller
could just specify a memory location at which it expects the callee to
write four ints. If we maxed each count out at 256 we could even cram it
all into one register :)

On Tuesday, August 30, 2016, mpriestman <[email protected]
javascript:_e(%7B%7D,'cvml','[email protected]');> wrote:

Issue to just discuss possible problems that could be added to the MIPS
track. Looking down the list of available ones from other languages (
http://exercism.io/languages/mips/contribute), a lot seem just too hard
for assembly (a lot involve string or data structure manipulation).
However, I think there are still some that could make the transition to
assembly. The following could be good candidates:

  • difference-of-squares - seems pretty straightforward, single
    integer input, single integer output.
  • nucleotide-count - simple input, but needs to return 4 integer
    values. Could use hi and lo parts of v0 and v1?
  • atbash-cipher - single string input, fixed size string output.
  • luhn - could make for an interesting challenge, string input,
    boolean result.
  • pangram - pretty similar to the isogram problem.
  • binary-search - could be fun too.

Could also try to come up with some new exercises just for the MIPS track
that are more "assembly-like".

Any thoughts?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#13, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAG6z-Ldh956TKCwD--x-3TU79YuqKRMks5qlLOvgaJpZM4JxDzm
.

@mpriestman
Copy link
Contributor Author

When I implemented the raindrops problem, I ended up writing a version of a couple of C functions (itoa, and strcat). As you mentioned above, these in themselves could make good exercises; pretty small and self-contained, easy to test, and once the student is happy with them, then could open the door to using them in more complicated solutions.

Might only want a couple of interesting ones though. For example, is strlen too easy? strdup is also pretty straightforward, but would involve a memory allocation. itoa is pretty meaty, and there are a few ways to solve it too.

@mpriestman
Copy link
Contributor Author

I like your idea of putting four results into a single register for the nucleotide count problem. A good example of packing smaller values into a large value.

@mpriestman
Copy link
Contributor Author

I've put in a PR for difference-of-squares, and having "a bash" at atbash-cipher.

@qjd2413
Copy link
Contributor

qjd2413 commented Sep 15, 2016

Certain exercises that require string computation seem doable, such as anagram or potentially bob.

In regards to dates, assembly has 4 input registers-- month, day, and year could be passed in through different registers. Assuming the response is either a string or integer, I think a problem like gigasecond would be useful (and a good application of an implementation of a "switch/case statement").
Edit: Thinking more about gigasecond and time in general, it seems like too much of a hassle to implement (no current time, no simple way to return more than two values)

@keiravillekode
Copy link
Contributor

I agree that gigasecond is not worth implementing. Of the exercises discussed in this thread, only anagram and two-bucket remain to be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants