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
(prompt('合言葉は?') !== 'たこやき') && document.write('だめだこりゃ') |
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
const shuffle = require('shuffle-array') | |
function defineMembers (memberCount = 10) { | |
const men = shuffle(new Array(memberCount).fill(null).map((_, i) => ({ | |
name: `man#${i}`, | |
rejectedBy: [], // 自分を拒否した異性の名前 | |
likes: [], // 好みの異性 | |
}))) | |
const women = shuffle(new Array(memberCount).fill(null).map((_, i) => ({ | |
name: `woman#${i}`, |
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
#!/usr/bin/env node | |
/** | |
* Gale–Shapley algorithm for Stable marriage problem | |
* | |
* https://en.wikipedia.org/wiki/Stable_marriage_problem | |
* http://toyokeizai.net/articles/-/11584 | |
*/ | |
'use strict' |
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
function createCounterWithNamedType(counterName = '') { | |
return function counter(state = 0, action) { | |
switch (action.type) { | |
case `INCREMENT_${counterName}`: | |
return state + 1; | |
case `DECREMENT_${counterName}`: | |
return state - 1; | |
default: | |
return 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
mkdir sugos-tutorial-06 | |
cd sugos-tutorial-06 | |
npm init -y | |
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
mkdir sugos-tutorial-06 | |
cd sugos-tutorial-06 | |
npm init -y | |
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
mkdir sugos-tutorial-05 | |
cd sugos-tutorial-05 | |
npm init -y | |
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
# Install as global module | |
npm install -g sugo-scaffold | |
# Show version to check if the installation succeeded | |
sugo-scaffold --version |
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
mkdir sugos-tutorial-03 | |
cd sugos-tutorial-03 | |
npm init -y | |
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
mkdir sugos-tutorial-02 | |
cd sugos-tutorial-02 | |
npm init -y | |
NewerOlder