Skip to content

Circular buffer #17

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

Closed
wants to merge 1 commit into from
Closed

Circular buffer #17

wants to merge 1 commit into from

Conversation

anthonygreen
Copy link
Contributor

An idea for an exercise.
Would appreciate feedback as to whether this is a useful exercise, how the tests could be improved, etc.

@kytrinyx
Copy link
Member

kytrinyx commented May 2, 2014

I like it! Would you put the README contents in the x-common repository? There are some details about this in the CONTRIBUTING file in the main exercism repository

@markijbema
Copy link
Contributor

I like it!

Did you consider where it should be placed in the curricilum? I think it would work best if it wasn't too close to other create-a-datatype type exercises (like linked list). As for the complexity, it seems relatively easy to me, so I think it could be one of the first datatype-exercises (at least before linked list).

Could you also add an example solution?

@anthonygreen
Copy link
Contributor Author

I've created a pull request for x-common exercism/problem-specifications#9
TODO:

  • Review the tests
  • Create example
  • Decide placement

@kytrinyx
Copy link
Member

kytrinyx commented May 8, 2014

I think this exercise makes sense somewhere around roman-numerals or so. It's just a guess, and I think a guess is totally adequate at this point.

@anthonygreen
Copy link
Contributor Author

I'll edit xruby/EXERCISES.txt accordingly

@anthonygreen
Copy link
Contributor Author

Updated tests and created example.rb

@markijbema
Copy link
Contributor

Could you please add skips to all but the first test?

@kytrinyx
Copy link
Member

kytrinyx commented May 8, 2014

Also, would you delete the README?

@anthonygreen
Copy link
Contributor Author

Done

@kytrinyx
Copy link
Member

kytrinyx commented May 8, 2014

I think this looks good. We'll probably discover all sorts of things about how it can be better once it gets put in front of real people (as we've discovered with pretty much every problem on exercism so far). In the meanwhile, let's get this into the progression!

Would you squash all of the commits?

Let me know if you want a walk-through of how that works (it's always hard to tell how much git experience people have).

@anthonygreen
Copy link
Contributor Author

The squashed commits are on a different branch https://github.com/anthonygreen/xruby/tree/circular-buffer
If you prefer me to do a rebase/squash I might need a walk-through.

@kytrinyx
Copy link
Member

kytrinyx commented May 9, 2014

Nice! You won't need to rebase.

Here's the command to get that new branch into this pull request to update it with the squashed code:

$ git push -f origin circular-buffer:circular_buffer

@anthonygreen
Copy link
Contributor Author

Done. Thanks for your patience BTW.

@kytrinyx
Copy link
Member

kytrinyx commented May 9, 2014

Aaaand merged in e029964 Thank you for working on this!

@kytrinyx kytrinyx closed this May 9, 2014
fluxusfrequency pushed a commit to fluxusfrequency/xruby that referenced this pull request May 9, 2014
@markijbema
Copy link
Contributor

Thanks a lot @anthonygreen !!

@fluxusfrequency
Copy link
Contributor

I'm excited to try this, but was unable to fetch it with exercism fetch ruby circular-buffer. Any idea why that wouldn't work?

@fluxusfrequency
Copy link
Contributor

Also, this:

There was an issue with your submission: Status: 400, Error: { We are unable to determine which exercise you're submitting ruby/circular-buffer/circular_buffer.rb to.}

@kytrinyx
Copy link
Member

Yeah, I forgot to deploy yesterday. Sorry about that. It should be up now.

@markijbema
Copy link
Contributor

We had this problem sometimes with our app. We thought we release something, but weren't totally sure. To fix that we saved the commits that were deployed somewhere on the server, and made them links to those commits on github (or actually, to the diffs with master). Not sure if it's worth the effort for exercism, but thought I'd just throw it in ;)

@kytrinyx
Copy link
Member

Thanks for the suggestion, I'll think about it.

@anthonygreen anthonygreen deleted the circular_buffer branch May 13, 2014 15:40
gchan pushed a commit to gchan/xruby that referenced this pull request Oct 18, 2016
petertseng added a commit to exercism/problem-specifications that referenced this pull request Jan 15, 2017
* circular-buffer: Add canonical data

The circular-buffer exercise was first added in 2014 May at #9, with
Ruby and Javascript as the initial implementing tracks:

* exercism/DEPRECATED.javascript#17
* exercism/ruby#17

Implementing tracks:

* https://github.com/exercism/xcsharp/blob/master/exercises/circular-buffer/CircularBufferTest.cs
* https://github.com/exercism/xdlang/blob/master/exercises/circular-buffer/circular_buffer.d
* https://github.com/exercism/xecmascript/blob/master/exercises/circular-buffer/circular-buffer.spec.js
* https://github.com/exercism/xerlang/blob/master/exercises/circular-buffer/circular_buffer_tests.erl
* https://github.com/exercism/xfsharp/blob/master/exercises/circular-buffer/CircularBufferTest.fs
* https://github.com/exercism/xgo/blob/master/exercises/circular-buffer/circular_buffer_test.go
* https://github.com/exercism/xjavascript/blob/master/exercises/circular-buffer/circular-buffer.spec.js
* https://github.com/exercism/xlfe/blob/master/exercises/circular-buffer/test/circular-buffer-tests.lfe
* https://github.com/exercism/xlua/blob/master/exercises/circular-buffer/circular-buffer_spec.lua
* https://github.com/exercism/xpascal/blob/master/exercises/circular-buffer/uCircularBufferTests.pas
* https://github.com/exercism/xpython/blob/master/exercises/circular-buffer/circular_buffer_test.py
* https://github.com/exercism/xruby/blob/master/exercises/circular-buffer/circular_buffer_test.rb
* https://github.com/exercism/xrust/blob/master/exercises/circular-buffer/tests/circular-buffer.rs

All tracks pretty much implement the same tests, except:

* Tracks typically have the "read item just written" and "each item can
  only be read once" tests combined. These tests split the two.
* In dynamically-typed languages, buffers may be able to store
  heterogeneous types. This concept is not expressed in these tests.
* In some statically-typed languages, buffers use generics, such that
  buffers may store any one type of the client's choosing. This concept
  is also not expressed in these tests.
* The final test (ensuring that overwrite drops the right items) was more
  complex: capacity 5, 3 writes, 2 reads, write, read, 4 writes, 2
  overwrites, 5 reads. It's been simplified to capacity 3, 3 writes, 1
  read, write, overwrite, 3 reads.

Closes https://github.com/exercism/todo/issues/79
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

Successfully merging this pull request may close these issues.

4 participants