Skip to content

Commit

Permalink
Support import from Cubic Timer
Browse files Browse the repository at this point in the history
  • Loading branch information
afedotov committed Apr 27, 2024
1 parent 1f34f1a commit f373c2b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/js/lib/tdconverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,13 @@ var TimerDataConverter = execMain(function() {
'sq1': 'sqrs',
'clock': 'clkwca',
'666': '666wca',
'777': '777wca'
'777': '777wca',
'333oh': '333oh',
'333bld': '333ni',
'444bld': '444bld',
'555bld': '555bld',
'333mbld': 'r3ni',
'333fmc': '333fm'
};
var name2idx = {};
var ret = [];
Expand All @@ -162,11 +168,12 @@ var TimerDataConverter = execMain(function() {
continue;
}
var name = line[0] + '-' + line[1];
var timeMs = Math.round(line[0] == '333mbld' ? ((~~(line[2] / 1000) % 1000000) * 1000) : line[2]);
var time = [{
'0': 0,
'1': 2000,
'2': -1
} [line[5]], Math.round(line[2])];
} [line[5]], timeMs];
if (!(name in name2idx)) {
name2idx[name] = ret.length;
ret.push({
Expand All @@ -182,6 +189,8 @@ var TimerDataConverter = execMain(function() {
return ret;
}];

Timers['CubicTimer'] = [/^"Puzzle";"Category";"Time\(millis\)";"Date\(millis\)";"Scramble";"Penalty";"Comment"/i, Timers['TwistyTimer'][1]];

Timers['BlockKeeper'] = [/^{"puzzles":\[{"name":/i, function(data) {
data = JSON.parse(stdStr(data))["puzzles"];
var ScrambleMap = {
Expand Down

0 comments on commit f373c2b

Please sign in to comment.