toCSV関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A list of solves as CSV, for a spreadsheet: a header, then a row a solve,
with lines ended CRLF as RFC 4180 has them. The columns are time (when,
ISO 8601), size, scramble, moves, count, solved, seconds and seed.
インポート
import { toCSV } from "@johnmorrisdotca/kyuubu";
定義
function toCSV(records: readonly SolveRecord[]): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
records | readonly SolveRecord[] | One or more solve records to export. |
戻り値
string
A list of solves as CSV, for a spreadsheet: a header, then a row a solve, with lines ended CRLF as RFC 4180 has them. The columns are time (when, ISO 8601), size, scramble, moves, count, solved, seconds and seed.
例
import { parseMoves, toCSV } from "@johnmorrisdotca/kyuubu";
const moves = parseMoves("R U2", 3)!;
const record = { size: 3, scramble: parseMoves("R", 3)!, moves: parseMoves("R'", 3)!, ms: 1000, seed: "docs" };
console.log(toCSV([record]));time,size,scramble,moves,count,solved,seconds,seed
,3,R,R',1,true,1.00,docs出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。