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

New features, change to row/column from x/y coordinate #8

Merged
merged 7 commits into from
Oct 1, 2015

Conversation

possibly
Copy link
Collaborator

In response to #7:
Width and Height now correspond with Rows and Columns. …

  • The more rows there are, the taller the height.
  • The more columns there are, the longer the width.
  • Instead of thinking in (x,y) coordinates, instead think in (row,col)
    where (0,0) is in the top left. This is how the code always worked, but
    speaking of (x,y) coordinates gets one thinking of a Cartesian graph
    where (0,0) is in the bottom left of Q1.
  • Changes to tests to test rectangles instead of squares to catch edge
    cases.
  • Changes in README to reflect this change.

Working towards #5, which will come after push/pop and shift/unshift row/col.

* The more rows there are, the taller the height.
* The more columns there are, the longer the width.
* Instead of thinking in (x,y) coordinates, instead think in (row,col)
where (0,0) is in the top left. This is how the code always worked, but
speaking of (x,y) coordinates gets one thinking of a Cartesian graph
where (0,0) is in the bottom left of Q1.
* Changes to tests to test rectangles instead of squares to catch edge
cases.
* Changes in README to reflect this change.
@possibly
Copy link
Collaborator Author

npm run test-coveralls

=============================== Coverage summary ===============================
Statements   : 100% ( 98/98 )
Branches     : 100% ( 34/34 )
Functions    : 100% ( 16/16 )
Lines        : 100% ( 95/95 )
================================================================================

npm run jshint

> fixed-2d-array@1.2.0 jshint /Users/tbro/dev/fixed-2d-array
> jshint test/* lib/*

npm run test

> fixed-2d-array@1.2.0 test /Users/tbro/dev/fixed-2d-array
> node test/test.js

TAP version 13
# Default values
ok 1 should be equal
ok 2 should be equal
ok 3 should throw
# getHeight and getWidth
ok 4 should be equal
ok 5 should be equal
# get and set
ok 6 should be equal
ok 7 should throw
ok 8 should throw
# get correct row and column
ok 9 should be equal
ok 10 should be equal
ok 11 should be equal
ok 12 should be equal
ok 13 should throw
ok 14 should throw
# set row and column
ok 15 should be equivalent
ok 16 should be equivalent
ok 17 should throw
ok 18 should throw
ok 19 should be equal
ok 20 should be equal
ok 21 should throw
ok 22 should throw
# forEach
ok 23 should be equal
# exception on index out of bounds
ok 24 should throw
ok 25 should throw
# sameSize
ok 26 (unnamed assert)
ok 27 (unnamed assert)
ok 28 should throw
# get correct number of neighbours
ok 29 should be equal
ok 30 should be equal
ok 31 should be equal
ok 32 should be equal
ok 33 should be equal
ok 34 should be equal
ok 35 should be equal
# areNeighbors
ok 36 (unnamed assert)
ok 37 (unnamed assert)
ok 38 (unnamed assert)
ok 39 should throw
ok 40 should throw
ok 41 should be equal
# pushRow
ok 42 should be equal
ok 43 should be equal
ok 44 should throw
ok 45 should be equal

1..45
# tests 45
# pass  45

# ok

tillarnold added a commit that referenced this pull request Oct 1, 2015
New features, change to row/column from x/y coordinate
@tillarnold tillarnold merged commit 639a5d9 into tillarnold:master Oct 1, 2015
@tillarnold
Copy link
Owner

Thanks. I gave you Push access to the repository. I won't have access to a Computer the next week.

@possibly
Copy link
Collaborator Author

possibly commented Oct 2, 2015

Awesome. Thanks for the support so far.

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.

None yet

2 participants