This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define DATA_COUNT 6 | |
int arabic_values[DATA_COUNT] = { 1, 2, 3, 4, 5, 6}; | |
char *roman_values[DATA_COUNT] = { "I", "II", "III", "IV", "V", "VI"}; | |
typedef struct Roman_Arabic_pair { | |
char * roman; | |
int arabic; | |
} Roman_Arabic_pair; | |
void check_arabic_to_roman(const Roman_Arabic_pair test_data, const char *actualRoman) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Full code base: | |
// https://github.com/JeffHoover/Data-Driven-GoL | |
// Hard to read bare assertion: | |
// Assert.AreEqual(State.DEAD, _ruleEngine.GetNextCellState(State.DEAD, numNeighbors)); | |
// Easier to read helper method: | |
Assert_Dead_Cell_Stays_Dead_With_X_Neighbors(numNeighbors)); | |
// Suggested by @mattslavicek - loses important information about cell starting state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Edit user</h1> | |
<%= form_for(@user) do |f| %> | |
<%= render 'fields', :f => f %> | |
<div class="actions"> | |
<%= f.submit "Update" %> | |
</div> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/views/shared/_form.html.erb: | |
<%= form_for(@user, button_text) do |f| %> | |
<%= render 'fields', :f => f %> | |
<div class="actions"> | |
<%= f.submit button_text %> | |
</div> | |
<% end %> |