TIY-Durham / 2015-FALL-FEE

Class repo for the Front-End Engineering class of the Fall 2015 cohort at TIY Durham
18 stars 12 forks source link

18 -- David White #344

Closed s4dmw closed 8 years ago

s4dmw commented 8 years ago
s4dmw commented 8 years ago

The Chessboard: It's Baaaaaack.

"Chess won't stay dead."

Time for a reboot. Chess won't defeat us! We're trying again, and this time, we'll win.

First, reset your tests.js and main.js. Wipe everything clean, except your 8x8 grid.

Use the Starting Point provided and write tests with mocha and chai in the browser for the API described; put the mocha boilerplate in a new file called tests.html. The tests should really have their own file, too; let's call it js/tests.js. What happens when you use browser-sync to view tests.html...? Maybe link some <scripts>, and don't forget the chai!

Start with tested Model-layer code that represents the current state of the board and each move in the game. How can we navigate through the game, move by move? How could we back up a step? Start over? Skip to the finish?

Feel free to use tracer bullets and interactive debugging to help you understand the internal state of the application, but don't leave breakpoints or tracer bullets lying around in your submitted code, please. Always start with "EnglishScript" -- pseudocode -- that explains your intent, so you have something to submit.

BEAST MODE

The next step is wiring up that core game logic to the visual representation of the board in HTML. How can we update the HTML -- the View-layer -- when a change occurs in the Model-layer? How can we signal the Model-layer that an interactive event -- clicking a button -- has occurred in the View-layer? That sounds like View Helpers and Controllers to me!

Write pseudocode for some of the Controllers -- Event Listeners and their associated callbacks -- and View Helpers -- Functions that just update the View. We'll need both of them to make this ship sail!

NIGHTMARE MODE

Can you write tested code for those View Helpers? How would you even write tests for that? Hmm... Give it a swing and document what approach you took in code comments. You'll may run into some difficulty; don't bulldog it. Write up your experience and what challenges you encountered.

s4dmw commented 8 years ago

Journal and Tutorial: https://github.com/s4dmw/s4dmw.github.io/pull/18

TIY-Assignments: https://github.com/s4dmw/TIY-Assignments/pull/33

TIY-Chessboard - redux: https://github.com/s4dmw/TIY-Chessboard/pull/3

kellymurray commented 8 years ago

Continue Improving given because:

al-the-x commented 8 years ago

Please review and close...