Reference · Cube engine and views
toCSVfunction
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 it
import { toCSV } from "@johnmorrisdotca/kyuubu";
Definition
function toCSV(records: readonly SolveRecord[]): string
Parameters
| Name | Type | Description |
|---|---|---|
records | readonly SolveRecord[] | One or more solve records to export. |
Returns
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.
Examples
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,docsWhat it prints (run when this page was built)