Skip to content

Commit

Permalink
Dev (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
goldbuick authored Jan 2, 2025
2 parents 4904d95 + 9d9229a commit 2d36347
Show file tree
Hide file tree
Showing 11 changed files with 264 additions and 269 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zed-software-system",
"private": true,
"version": "0.21.19",
"version": "0.21.22",
"type": "module",
"scripts": {
"sloc": "npx sloc zss",
Expand Down
1 change: 1 addition & 0 deletions zss/device/synth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ function createsynth() {
// reset starting offset
--pacercount
if (pacercount === 0) {
pacer.clear()
pacertime = -1
}
break
Expand Down
2 changes: 1 addition & 1 deletion zss/gadget/data/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export const TAPE_MAX_LINES = 128

export enum TAPE_DISPLAY {
TOP,
BOTTOM,
FULL,
BOTTOM,
SPLIT_Y,
SPLIT_Y_ALT,
MAX,
Expand Down
10 changes: 5 additions & 5 deletions zss/mapping/2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function ptwithin(
return x >= left && x <= right && y >= top && y <= bottom
}

export function linePoints(
export function linepoints(
x0: number,
y0: number,
x1: number,
Expand Down Expand Up @@ -62,7 +62,7 @@ export function linePoints(
return points
}

function ellipsePoints(
function ellipsepoints(
points: PT[],
x0: number,
y0: number,
Expand All @@ -75,7 +75,7 @@ function ellipsePoints(
points.push({ x: x0 - x, y: y0 - y })
}

export function circlePoints(x0: number, y0: number, r: number) {
export function circlepoints(x0: number, y0: number, r: number) {
const points: PT[] = []

let d = 5 - 4 * r
Expand All @@ -87,8 +87,8 @@ export function circlePoints(x0: number, y0: number, r: number) {
let deltaB = 3 * 4

while (x <= y) {
ellipsePoints(points, x0, y0, x, y)
ellipsePoints(points, x0, y0, y, x)
ellipsepoints(points, x0, y0, x, y)
ellipsepoints(points, x0, y0, y, x)

if (d > 0) {
d += deltaA
Expand Down
4 changes: 2 additions & 2 deletions zss/mapping/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export function range(a: number, b?: number, step?: number) {
return list
}

function randomItem<T>(array: T[]) {
function randomitem<T>(array: T[]) {
return array[randominteger(0, array.length - 1)]
}

export function pick<T>(...args: T[]) {
return randomItem(args.flat())
return randomitem(args.flat())
}

export function addToArray<T>(array: T[], value: T) {
Expand Down
3 changes: 2 additions & 1 deletion zss/memory/book.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ export function bookelementdisplayread(
return {
char: element?.char ?? kind?.char ?? 1,
color: element?.color ?? kind?.color ?? COLOR.WHITE,
bg: element?.bg ?? kind?.bg ?? COLOR.ONBORROW,
bg: element?.bg ?? kind?.bg ?? COLOR.ONCLEAR,
light: element?.light ?? kind?.light,
}
}

Expand Down
23 changes: 23 additions & 0 deletions zss/memory/codepage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ function applyelementstats(codepage: CODE_PAGE, element: BOARD_ELEMENT) {
case 'char':
case 'color':
case 'bg':
case 'light':
case 'p1':
case 'p2':
case 'p3':
Expand Down Expand Up @@ -334,6 +335,28 @@ export function codepagereaddata<T extends CODE_PAGE_TYPE>(
codepage.board = createboard()
}
codepage.board.id = codepage.id
const stats = codepagereadstatdefaults(codepage)
codepage.board.isdark = ispresent(stats.isdark) && stats.isdark ? 1 : 0
// @ts-expect-error ugh
codepage.board.over = stats.over ?? codepage.board.over
// @ts-expect-error ugh
codepage.board.under = stats.under ?? codepage.board.under
// @ts-expect-error ugh
codepage.board.exitnorth = stats.exitnorth ?? codepage.board.exitnorth
// @ts-expect-error ugh
codepage.board.exitsouth = stats.exitsouth ?? codepage.board.exitsouth
// @ts-expect-error ugh
codepage.board.exitwest = stats.exitwest ?? codepage.board.exitwest
// @ts-expect-error ugh
codepage.board.exiteast = stats.exiteast ?? codepage.board.exiteast
// @ts-expect-error ugh
codepage.board.timelimit = stats.timelimit ?? codepage.board.timelimit
// @ts-expect-error ugh
codepage.board.restartonzap =
stats.restartonzap ?? codepage.board.restartonzap
// @ts-expect-error ugh
codepage.board.maxplayershots =
stats.maxplayershots ?? codepage.board.maxplayershots
return codepage.board as MAYBE<CODE_PAGE_TYPE_MAP[T]>
}
case CODE_PAGE_TYPE.OBJECT: {
Expand Down
Loading

0 comments on commit 2d36347

Please sign in to comment.