This file contains hidden or 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 attackA () { | |
damage(10) // ダメージ10を与える | |
effect() // ダメージエフェクトを出す | |
powerUp() // attackAは攻撃力が上がる | |
} | |
// 効果はないけどダメージが強い | |
function attackB () { | |
damage(20) // ダメージ20を与える |
This file contains hidden or 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 attackA () { | |
attackBase(10) // ダメージ10を与える | |
powerUp() // attackAは攻撃力が上がる | |
} | |
// 効果はないけどダメージが強い | |
function attackB () { | |
attackBase(20) // ダメージ20を与える | |
} |
This file contains hidden or 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 MEMBER_COUNT = 300 | |
// 使っても良い金額 | |
const USABLE_MONEY = 300 | |
// 遠足での子供の確認 | |
function childrenCheck () { | |
// 全員のお金チェック | |
for (let i = 0; i < MEMBER_COUNT; i++) { | |
if (useMoney > USABLE_MONEY) { |
This file contains hidden or 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 childrenCheck () { | |
// 全員のお金チェック | |
for (let i = 0; i < 300; i++) { | |
if (useMoney > 300) { | |
alert('使いすぎ!!!') | |
} | |
} | |
// 人員確認 | |
if (currentMemberCount !== 300) { |
This file contains hidden or 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
// 東京在住の1年目エンジニアならログを出す | |
// あまり良くない書き方 | |
// 「ネストが深い」と言われ、複数の条件を意識しながら処理を読み進めていかなければならない | |
function isTokyoKakedashiEnginner (person) { | |
if (person.address === 'Tokyo') { | |
console.log('東京在住です') | |
if (person.job === 'Enginner') { | |
console.log('エンジニアです') | |
if (person.careerYear <= 1) { |
This file contains hidden or 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
var accounts = ['account1', 'account2'] | |
// 認証用インスタンス(複数入れられるように) | |
var twitterInstances = {}; | |
for (var i in accounts) { | |
var instance = TwitterWebService.getInstance( | |
'XXXXXXXXXXXXXXXXXXXX', // 作成したアプリケーションのConsumer Key | |
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' // 作成したアプリケーションのConsumer Secret | |
); | |
// サービス名をアカウント名にしておく |
This file contains hidden or 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 followUsers () { | |
var users = [ | |
'belltreeSzk', | |
'xxxxxxx', | |
]; | |
// 複数アカウントでフォローする | |
for (var key in twitterInstances) { | |
instance = twitterInstances[key] | |
var service = instance.getService(); |
This file contains hidden or 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
'use strict'; | |
const consumerKey = 'CONSUMER_KEY' | |
const consumerSecret = 'CONSUMER_SECRET' | |
const client = TwitterClient.getInstance(consumerKey, consumerSecret) | |
/** | |
* ①Twitterで作ったアプリに登録するための callbackUrl を取得する | |
* 実行後 『表示』→『ログ』でURLを確認してTwitterアプリに登録 |
This file contains hidden or 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
// アカウント分の認証は行っておく | |
var accounts = ['account1', 'account2','account3', 'account4','account5', 'account6','account7', 'account8','account9', 'account10',] | |
// フォローする | |
function follow () { | |
// 今回APIを実行する人を取得 | |
var titleRow = 1; // 『アカウントID』とか書いている部分の行数 | |
var startRow = 1 + titleRow; // 1行目は『アカウントID』とか書いているので2行目から | |
var startCol = 1; | |
var endRow = sheetData.getLastRow() - titleRow; // 最後の行まで |
This file contains hidden or 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
'use strict'; | |
const consumerKey = 'XXXXXXXXXXXXXXXXXXXXXXX' | |
const consumerSecret = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
const client = TwitterClient.getInstance(consumerKey, consumerSecret) | |
/** | |
* ①Twitterで作ったアプリに登録するための callbackUrl を取得する | |
* 実行後 『表示』→『ログ』でURLを確認してTwitterアプリに登録 |