Skip to content

Instantly share code, notes, and snippets.

@kokudori
Last active August 29, 2015 14:07
Show Gist options
  • Save kokudori/9d9f8f0e8cdea3a24c48 to your computer and use it in GitHub Desktop.
Save kokudori/9d9f8f0e8cdea3a24c48 to your computer and use it in GitHub Desktop.
Cytusメモ

Chapter 1

タイトル ランク スコア
Light up my LOVE 6 MM
Ververg 5 MM
Ververg ver.B 9 A 948145
Chemical Star 3 MM
Visions 6 MM
Les Parfums de L'Amour 5 MM
Retrospective 4 MM
The Silence 7 MM
D R G 5 MM
Secret Garden 4 MM
Hot Air Balloon 5 MM

Chapter 2

タイトル ランク スコア
Iris 7 MM
Sanctity 7 MM
Sacred 7 MM
Green Eyes 6 MM
Nocturnal Type 8 S 997103
Precipitation 6 MM
Precipitation ver.B 6 MM
Hard Landing 8 A 910946
Entrance 9 S 958455
Precipitation at the Entrance 9 A 944349
Precipitation at the Entrance II 9 A 909738

Chapter 3

タイトル ランク スコア
The Riddle Story 8 MM
Libera me 7 MM
COSMO 7 MM
Prismatic Lollipops 7 A 947267
otome 7 MM
Spectrum 5 MM
Halcyon 9 A 913552
The black Case 7 MM
Saika 7 MM
Saika ver.B 7 MM

Chapter 4

タイトル ランク スコア
Evil Force 8 A 911704
New world 6 MM
Landscape 7 S 951757
Future world 7 MM
Parousia 9 A 914575
Skuld 6 MM
DARKNESS 8 A 924827
Beyond 6 MM
AREA184 9 A 934197
Sweetness and Love 8 A 901665

Chapter 5

タイトル ランク スコア
HOLY KNIGHT 8 S 981594
DINO 7 S 962666
Majestic Phoenix 7 A 924152
Sleepless Jasmine 6 MM
chocological 6 MM
Recollections 9 A 911807
Total Sphere 8 A 930584
Just A Trip 8 A 925499
Zauberkugel 9 S 955808
BIOTONIC 9 A 911499

Chapter 6

タイトル ランク スコア
Dragon Warrior 7 MM
Selfish Gene 6 MM
Realize 7 MM
Colorful Skies 9 A 908619
It's a wonderful world 6 MM
Bloody Purity 9 A 921482
Logical Steps 8 S 998996
Niflheimr 8 S 956904
OLD GOLD 8 S 995256
THE BLOCKS WE LOVED 9 A 917344

Chapter 7

タイトル ランク スコア
Black Lair 9 B 889880
The Last Illusion 8 A 917213
Galaxy Collapse 8 --
L 9 --
L2(Ver.A) 9 --
L2(Ver.B) 9 --
Gate of Expectancy 8 --
Rainbow Night Sky Highway 9 B 882822
Quantum Labyrinth 7 MM
Musik 7 MM
Hercule 7 A 934802
Aquatic Poseidon 8 A 908730

Chapter 8

タイトル ランク スコア
Masquerade 9 A 908281
Her Sword 7 MM
Morpho 8 S 994442
Slit 8 A 932959
Slit I 9 B 889343
Slit O 9 B 873542
Laplace 9 B 898632
Q 9 A 932886
SCHERZO 7 A 949166
AXION 9 B 877805
Code03 6 MM
Reverence 8 MM

Chapter 9

タイトル ランク スコア
Oriens 9 --
Hey wonder ~人生は不思議~ 6 MM
Brionac ~Lugh Lamhfhata~ 7 MM
First Gate 8 --
First Gate OVERDRIVE 9 --
Qualia 7 S 951859
East West Wobble 8 --
Warlords of Atlantis 8 --
To Further Dream 8 --
COMA 8 S 957199
Codename:Zero 9 --

Chapter 10

タイトル ランク スコア
FREEDOM DIVE 9 --
Halloween Party 9 --
YURERO~時間は過ぎ去ってイクから~ 7 MM
Twenty One 7 --
Solar Wind 8 --
Red Eyes 7 --
Finite circuit 7 --
Set Free(KIVΛ Edition) 6 MM
DO NOT WAKE 9 --
GATORIX 9 --

Chapter S

タイトル ランク スコア
LVBNR5 SCHWARZ 7 MM
VIVERE LA VITA 7 MM
Rain of Fire 7 MM
Molto Allegro 7 MM
REVOLUXIONIST 9 B 831760
LVBNR5 WEIβ 6 MM
CHAOTIC DRIVE 7 A 949331
Outsider 8 A 919742
REQUIEM 9 --
The Purified 9 --

Chapter K

タイトル ランク スコア
The Way We Were 6 MM
The Sanctuary 8 A 937134
The Red Coronation 9 B 883700
Forbidden Codex 7 MM
Knight of Firmament 7 MM
Load of Crimson Rose 8 MM
Predawn 7 MM
The Fallen BLOOM 7 MM
Where You Are Not 8 MM
Music. The eternity of us 7 MM

Prologue

タイトル ランク スコア
Process 8 MM
Endless Journey 7 MM
Shoot out 7 MM
LNS OP 6 MM
Blue Eyes 9 A 901166
Diskord 7 MM
Infernus 8 MM
Megaera 8 A 926582
Violet 9 A 904341
iAzucar! 8 A 929471
var fs = require('fs'),
_ = require('underscore'),
client = require('cheerio-httpcli');
// fetch();
var scores = JSON.parse(fs.readFileSync('./score.json'));
var results = JSON.parse(fs.readFileSync('./cytus.json'));
var width = {
title: (function () {
var lengths = results.map(function (item) {
return item.musics.map(function (music) {
return length(music.title);
});
}).reduce(function (x, y) {
return x.concat(y);
});
return 1 + Math.max.apply(null, lengths) + 1;
})(),
rank: 1 + length('ランク') + 1,
score: 1 + length('X 999999') + 1
};
var header = (function () {
var header = '|' + [
print('タイトル', 'title'),
print('ランク', 'rank'),
print('スコア', 'score')
].join('|') + '|';
return [spliter('-'), header, spliter('=')].join('\n') + '\n';
})();
var content = _.zip(results, scores)
.map(function (value, i) {
var chapter = (function () {
var header = Array(value[0].title.length + 1).join('=');
return value[0].title + '\n' + header + '\n';
})();
return chapter + header + _.zip(value[0].musics, value[1])
.map(function (value) {
return '|' + row(value[0], value[1]) + '|';
}).join('\n' + spliter('-') + '\n')
+ '\n' + spliter('-') + '\n';
}).join('\n');
fs.writeFileSync('./cytus.rst', content)
function row(music, score) {
return [
print(music.title, 'title'),
print(music.rank, 'rank'),
print(score, 'score')
].join('|');
}
function print(text, type) {
var padding = width[type] - length(text);
var trim = Array(Math.floor(padding / 2) + 1).join(' ');
var first = padding % 2 != 0 ? ' ' : '';
return first + trim + text + trim;
}
function length(text) {
var isHalf = function (char) {
var point = char.charCodeAt(0);
return (0x0 <= point && point < 0x81)
|| (point == 0xf8f0) || (char == 'β') || (char == 'Λ')
|| (0xff61 <= point && point < 0xffa0)
|| (0xf8f1 <= point && point < 0xf8f4);
};
return text.split('')
.map(function (char) {
return isHalf(char) ? 1 : 2;
}).reduce(function (x, y) {
return x + y;
});
}
function spliter(sign) {
return [
'+',
Array(width.title + 1).join(sign),
'+',
Array(width.rank + 1).join(sign),
'+',
Array(width.score + 1).join(sign),
'+'
].join('');
}
function fetch() {
var url = 'http://wikiwiki.jp/cytus/?%B6%CA%CC%BE%A5%EA%A5%B9%A5%C8';
client.fetch(url, function (err, $, res) {
var result = $('table[class="style_table"] tbody').toArray()
.map(function (e, i) {
return $(e).find('tr').map(function (_, e) {
var $$ = $(e),
offset = i === 11 ? 1 : 0;
return {
title: $$.find('td').eq(1 + offset).text(),
rank: $$.find('td').eq(3 + offset).text()
};
}).toArray();
})
.map(function (musics, i) {
var title = (function (index) {
switch (index) {
case 11:
return 'Chapter S';
case 12:
return 'Chapter K';
case 13:
return 'Prologue';
default:
return 'Chapter ' + index;
}
})(i + 1);
return {
title: title,
musics: musics
};
});
fs.writeFileSync('./cytus.json', JSON.stringify(result, null, 2));
});
}
[
{
"title": "Chapter 1",
"musics": [
{
"title": "Light up my LOVE",
"rank": "6"
},
{
"title": "Ververg",
"rank": "5"
},
{
"title": "Ververg ver.B",
"rank": "9"
},
{
"title": "Chemical Star",
"rank": "3"
},
{
"title": "Visions",
"rank": "6"
},
{
"title": "Les Parfums de L'Amour",
"rank": "5"
},
{
"title": "Retrospective",
"rank": "4"
},
{
"title": "The Silence",
"rank": "7"
},
{
"title": "D R G",
"rank": "5"
},
{
"title": "Secret Garden",
"rank": "4"
},
{
"title": "Hot Air Balloon",
"rank": "5"
}
]
},
{
"title": "Chapter 2",
"musics": [
{
"title": "Iris",
"rank": "7"
},
{
"title": "Sanctity",
"rank": "7"
},
{
"title": "Sacred",
"rank": "7"
},
{
"title": "Green Eyes",
"rank": "6"
},
{
"title": "Nocturnal Type",
"rank": "8"
},
{
"title": "Precipitation",
"rank": "6"
},
{
"title": "Precipitation ver.B",
"rank": "6"
},
{
"title": "Hard Landing",
"rank": "8"
},
{
"title": "Entrance",
"rank": "9"
},
{
"title": "Precipitation at the Entrance",
"rank": "9"
},
{
"title": "Precipitation at the Entrance II",
"rank": "9"
}
]
},
{
"title": "Chapter 3",
"musics": [
{
"title": "The Riddle Story",
"rank": "8"
},
{
"title": "Libera me",
"rank": "7"
},
{
"title": "COSMO",
"rank": "7"
},
{
"title": "Prismatic Lollipops",
"rank": "7"
},
{
"title": "otome",
"rank": "7"
},
{
"title": "Spectrum",
"rank": "5"
},
{
"title": "Halcyon",
"rank": "9"
},
{
"title": "The black Case",
"rank": "7"
},
{
"title": "Saika",
"rank": "7"
},
{
"title": "Saika ver.B",
"rank": "7"
}
]
},
{
"title": "Chapter 4",
"musics": [
{
"title": "Evil Force",
"rank": "8"
},
{
"title": "New world",
"rank": "6"
},
{
"title": "Landscape",
"rank": "7"
},
{
"title": "Future world",
"rank": "7"
},
{
"title": "Parousia",
"rank": "9"
},
{
"title": "Skuld",
"rank": "6"
},
{
"title": "DARKNESS",
"rank": "8"
},
{
"title": "Beyond",
"rank": "6"
},
{
"title": "AREA184",
"rank": "9"
},
{
"title": "Sweetness and Love",
"rank": "8"
}
]
},
{
"title": "Chapter 5",
"musics": [
{
"title": "HOLY KNIGHT",
"rank": "8"
},
{
"title": "DINO",
"rank": "7"
},
{
"title": "Majestic Phoenix",
"rank": "7"
},
{
"title": "Sleepless Jasmine",
"rank": "6"
},
{
"title": "chocological",
"rank": "6"
},
{
"title": "Recollections",
"rank": "9"
},
{
"title": "Total Sphere",
"rank": "8"
},
{
"title": "Just A Trip",
"rank": "8"
},
{
"title": "Zauberkugel",
"rank": "9"
},
{
"title": "BIOTONIC",
"rank": "9"
}
]
},
{
"title": "Chapter 6",
"musics": [
{
"title": "Dragon Warrior",
"rank": "7"
},
{
"title": "Selfish Gene",
"rank": "6"
},
{
"title": "Realize",
"rank": "7"
},
{
"title": "Colorful Skies",
"rank": "9"
},
{
"title": "It's a wonderful world",
"rank": "6"
},
{
"title": "Bloody Purity",
"rank": "9"
},
{
"title": "Logical Steps",
"rank": "8"
},
{
"title": "Niflheimr",
"rank": "8"
},
{
"title": "OLD GOLD",
"rank": "8"
},
{
"title": "THE BLOCKS WE LOVED",
"rank": "9"
}
]
},
{
"title": "Chapter 7",
"musics": [
{
"title": "Black Lair",
"rank": "9"
},
{
"title": "The Last Illusion",
"rank": "8"
},
{
"title": "Galaxy Collapse",
"rank": "8"
},
{
"title": "L",
"rank": "9"
},
{
"title": "L2(Ver.A)",
"rank": "9"
},
{
"title": "L2(Ver.B)",
"rank": "9"
},
{
"title": "Gate of Expectancy",
"rank": "8"
},
{
"title": "Rainbow Night Sky Highway",
"rank": "9"
},
{
"title": "Quantum Labyrinth",
"rank": "7"
},
{
"title": "Musik",
"rank": "7"
},
{
"title": "Hercule",
"rank": "7"
},
{
"title": "Aquatic Poseidon",
"rank": "8"
}
]
},
{
"title": "Chapter 8",
"musics": [
{
"title": "Masquerade",
"rank": "9"
},
{
"title": "Her Sword",
"rank": "7"
},
{
"title": "Morpho",
"rank": "8"
},
{
"title": "Slit",
"rank": "8"
},
{
"title": "Slit I",
"rank": "9"
},
{
"title": "Slit O",
"rank": "9"
},
{
"title": "Laplace",
"rank": "9"
},
{
"title": "Q",
"rank": "9"
},
{
"title": "SCHERZO",
"rank": "7"
},
{
"title": "AXION",
"rank": "9"
},
{
"title": "Code03",
"rank": "6"
},
{
"title": "Reverence",
"rank": "8"
}
]
},
{
"title": "Chapter 9",
"musics": [
{
"title": "Oriens",
"rank": "9"
},
{
"title": "Hey wonder ~人生は不思議~",
"rank": "6"
},
{
"title": "Brionac ~Lugh Lamhfhata~",
"rank": "7"
},
{
"title": "First Gate",
"rank": "8"
},
{
"title": "First Gate OVERDRIVE",
"rank": "9"
},
{
"title": "Qualia",
"rank": "7"
},
{
"title": "East West Wobble",
"rank": "8"
},
{
"title": "Warlords of Atlantis",
"rank": "8"
},
{
"title": "To Further Dream",
"rank": "8"
},
{
"title": "COMA",
"rank": "8"
},
{
"title": "Codename:Zero",
"rank": "9"
}
]
},
{
"title": "Chapter 10",
"musics": [
{
"title": "FREEDOM DIVE",
"rank": "9"
},
{
"title": "Halloween Party",
"rank": "9"
},
{
"title": "YURERO~時間は過ぎ去ってイクから~",
"rank": "7"
},
{
"title": "Twenty One",
"rank": "7"
},
{
"title": "Solar Wind",
"rank": "8"
},
{
"title": "Red Eyes",
"rank": "7"
},
{
"title": "Finite circuit",
"rank": "7"
},
{
"title": "Set Free(KIVΛ Edition)",
"rank": "6"
},
{
"title": "DO NOT WAKE",
"rank": "9"
},
{
"title": "GATORIX",
"rank": "9"
}
]
},
{
"title": "Chapter S",
"musics": [
{
"title": "LVBNR5 SCHWARZ",
"rank": "7"
},
{
"title": "VIVERE LA VITA",
"rank": "7"
},
{
"title": "Rain of Fire",
"rank": "7"
},
{
"title": "Molto Allegro",
"rank": "7"
},
{
"title": "REVOLUXIONIST",
"rank": "9"
},
{
"title": "LVBNR5 WEIβ",
"rank": "6"
},
{
"title": "CHAOTIC DRIVE",
"rank": "7"
},
{
"title": "Outsider",
"rank": "8"
},
{
"title": "REQUIEM",
"rank": "9"
},
{
"title": "The Purified",
"rank": "9"
}
]
},
{
"title": "Chapter K",
"musics": [
{
"title": "The Way We Were",
"rank": "6"
},
{
"title": "The Sanctuary",
"rank": "8"
},
{
"title": "The Red Coronation",
"rank": "9"
},
{
"title": "Forbidden Codex",
"rank": "7"
},
{
"title": "Knight of Firmament",
"rank": "7"
},
{
"title": "Load of Crimson Rose",
"rank": "8"
},
{
"title": "Predawn",
"rank": "7"
},
{
"title": "The Fallen BLOOM",
"rank": "7"
},
{
"title": "Where You Are Not",
"rank": "8"
},
{
"title": "Music. The eternity of us",
"rank": "7"
}
]
},
{
"title": "Prologue",
"musics": [
{
"title": "Process",
"rank": "8"
},
{
"title": "Endless Journey",
"rank": "7"
},
{
"title": "Shoot out",
"rank": "7"
},
{
"title": "LNS OP",
"rank": "6"
},
{
"title": "Blue Eyes",
"rank": "9"
},
{
"title": "Diskord",
"rank": "7"
},
{
"title": "Infernus",
"rank": "8"
},
{
"title": "Megaera",
"rank": "8"
},
{
"title": "Violet",
"rank": "9"
},
{
"title": "iAzucar!",
"rank": "8"
}
]
}
]
{
"name": "cytus",
"version": "0.0.0",
"description": "score.jsonを必要に応じて編集した後、`node cytus.js`でcytus.rstが作れます",
"main": "cytus.js",
"dependencies": {
"cheerio-httpcli": "^0.2.0",
"underscore": "^1.7.0"
},
"author": "Kokudori",
"license": "MIT"
}
[
["MM", "MM", "A 948145", "MM", "MM", "MM", "MM", "MM", "MM", "MM", "MM"],
["MM", "MM", "MM", "MM", "S 997103", "MM", "MM", "A 910946", "S 958455", "A 944349", "A 909738"],
["MM", "MM", "MM", "A 947267", "MM", "MM", "A 913552", "MM", "MM", "MM"],
["A 911704", "MM", "S 951757", "MM", "A 914575", "MM", "A 924827", "MM", "A 934197", "A 901665"],
["S 981594", "S 962666", "A 924152", "MM", "MM", "A 911807", "A 930584", "A 925499", "S 955808", "A 911499"],
["MM", "MM", "MM", "A 908619", "MM", "A 921482", "S 998996", "S 956904", "S 995256", "A 917344"],
["B 889880", "A 917213", "--", "--", "--", "--", "--", "B 882822", "MM", "MM", "A 934802", "A 908730"],
["A 908281", "MM", "S 994442", "A 932959", "B 889343", "B 873542", "B 898632", "A 932886", "A 949166", "B 877805", "MM", "MM"],
["--", "MM", "MM", "--", "--", "S 951859", "--", "--", "--", "S 957199", "--"],
["--", "--", "MM", "--", "--", "--", "--", "MM", "--", "--"],
["MM", "MM", "MM", "MM", "B 831760", "MM", "A 949331", "A 919742", "--", "--"],
["MM", "A 937134", "B 883700", "MM", "MM", "MM", "MM", "MM", "MM", "MM"],
["MM", "MM", "MM", "MM", "A 901166", "MM", "MM", "A 926582", "A 904341", "A 929471"]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment