Skip to content

Commit

Permalink
sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
tailuge committed Dec 27, 2024
1 parent 0dcfd0d commit 31b109e
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/diagram.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mathaven.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/model/physics/mathaven.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class Mathaven {
this.updateAngularVelocity(ΔP)
this.updateWorkDone(ΔP)
if (this.i++ > 10 * this.N) {
throw "Solution not found"
throw new Error("Solution not found")
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/view/cameratop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { TableGeometry } from "./tablegeometry"
import { R } from "../model/physics/constants"

export class CameraTop {
static aspectLimit = 1.78
static portrait = 0.95
static fov = 20
static zoomFactor = 1
static readonly aspectLimit = 1.78
static readonly portrait = 0.95
static readonly fov = 20
static readonly zoomFactor = 1
static viewPoint(aspectRatio, fov) {
const dist = CameraTop.zoomFactor / (2 * Math.tan((fov * Math.PI) / 360))

Expand Down
6 changes: 3 additions & 3 deletions src/view/tablemesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@ export class TableMesh {
return group
}

private cloth = new MeshPhongMaterial({
private readonly cloth = new MeshPhongMaterial({
color: 0x4455b9,
wireframe: false,
flatShading: true,
transparent: false,
})

private cushion = new MeshPhongMaterial({
private readonly cushion = new MeshPhongMaterial({
color: 0x5465b9,
wireframe: false,
flatShading: true,
transparent: false,
})

private pocket = new MeshPhongMaterial({
private readonly pocket = new MeshPhongMaterial({
color: 0x445599,
wireframe: false,
flatShading: true,
Expand Down
2 changes: 1 addition & 1 deletion src/view/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Snooker } from "../controller/rules/snooker"

export class View {
readonly scene = new Scene()
private renderer: WebGLRenderer | undefined
private readonly renderer: WebGLRenderer | undefined
camera: Camera
windowWidth = 1
windowHeight = 1
Expand Down
2 changes: 1 addition & 1 deletion test/gen/diamond.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe("jsonCrush", () => {
const uncrushed = JSONCrush.uncrush(crushed)
const str = `('init!["O#P8646P2k5P8642O2k3P8649,0,-q147178X95878387P146988956X633uO7W9926X808k99PW056229580X7W623,q395893906X18687O0309834W456146122O7850v1321444826OW7943457746683393O8454_2104309055O03341822824u8297O8441550856490995P032X236957_79XO90u931V9k5247PW0X95v076Y56k3O8k8_10_246741P13V348623230549O0147452_1033V707P1443874k66455214O829968k8__169O1588_63v3212903O96158_Y6748612O054926Y98Wu618O9624122853032372P032284760V8649X5O9379_6790117894P09999597X507342,q107645661715287P44620987176293686,q03092u130422934P081Y68504579432,q39176k783899214O4556_91087890X,q1376920363088v4O5V9_88u113683,q1546284949v7069O6839774698702815]~shots![Z0N0Dj4396696969_9086$"NH#J!0*0N0D3.W415716V74614$H6321V2660731099Njk1k791214Y5VBS*0N0D3.167138993774994$H7723930460142693Nj1814736084u1383J!0*0N0D-2.688443315529157L4.91uWWWWW05FH179Y57774786289NH28432388628761u7BS* j299982Y845832245DH173603957109Y912L2.3088VFj3149266811670549NH315X10844_9W5J!0* H1W01734154167V7D-q13Yu687378848L4._38VFqX74810X7v8907NH5160592268528739BQ*UDH4171X21572609Y6TH7V95473V12_vNH118u0910501101J!0*UDj8218k8959429391T-q3338173Y5Y9613NH141042v566846626B%0N0Jd!4)])*H283974710158v5Nj09673863V264726D-q031V310v0Y803TH8020231743347841NH4430928130920293J!0*HW45045045045045045NH0k5k5k5k5k54Dq47611887Y484743Lq179Fq1_v960328XVNj3869310611859547BQ*j07471231X4318555Nj2905478797790549D-5.3W382623_4579Lq179Fq04X902vW64376NH1787851608026901J!0*j06V6V6V6V6V7Nju6V6V6V6V674D-q693163637X53331L2.1615FqX76_0921v9uNHk14410388Y1246BQ*j01v1v1v1v1v14Nj2Y7Y7Y7Y7Y77Dj71Y0924uu4_6Lq3V5WWWWW04FH660441524886108NH170720592u630506J!0)]~start!1718606k61k~now!171860Y8X93~score!37~wholeGame!false)*),ZBJ!0),('type!'RERACK'~ballinfo!('balls![('poD~z!0)~angle!F~po%H0.J~z!0)~iL~power!N~y!O,HP,jQ%q179N0Jd!6)])S%j8646Nj2k16666666666672Jd!1)])TLq6211uWWWW01FUH1636367Y88848386NHu14418597798Y44V75W00X19Y65Z('type!'AIM'~offset!('x!_27j-Hk40q1.u25v35 jW32u6X98342282_N"j245482363X30444#208704710v58783$L3.438VF%s!('x!␁%$#" vuqkj_ZYXWVUTSQPONLJHFDB*_`

const data = JSONCrush.uncrush(str)
JSONCrush.uncrush(str)

const urlWith01 = `https://tailuge.github.io/billiards/dist/?ruletype=snooker&state=(%27init!%5B%24S%25%2C-1.3k3116176132592S392896X420725955S8647P2399S8648P0003S28271qk5472k1P0qj74X66530_44P10113773477X8915P013226625179665162%2C1.342441621430767S108Z5u9855X333P70k0j946315961S22121013266608228S01398298098_23342P08_5887062886981P859394893u04122S0Zj716879795267Pjq6428k0u318P1568194163q99122P8279k42308_Z9S26594240995292806Pk6468173739k2608S677121u5X03j1PZ485207830185q7P41196295062043886P93q076140686j3P62j1463_863103%2C1.09264_70930971S03225612439160074S94422995_659738S0979k77046144u6P930Z03740437u7S4_5661j69040X7P6965824706744314Sk9772348q0321838%2C1.u8073830073955P3j4708855488Z46%2C1.Z20323952697277P4701230941888316P506334289u1394P4225u80q879383%5D~shots!%5B%200LH1FH099255099Z_8004%23%24LY%25%2BH076WLH060Z0Z0Z0Z038FY8862X791716634%23H803u62391224862LH611j04k2686204BV*Y06263u8098718637LY293388879Z10309F3.957737u7034906U2.1123_vH606461X8k1521LYq2_8809u4433826%2BH1j6j6j6j6j69LH%261.39073810k3203XU1.277TkvH010X557221Z47u1LY5865438528159082BN0%22QHk252252252252252F2.9858X1041547673DH5j6477606479X9LH377X08k22597k7%2BY03153153153153153LY19Z9Z9Z9Z9Z9F-2.5774k995_u483DHZ1494870k150404LH4124900968733jjBNY8646LY24016666666666672Jd!4)%5D)*Y012318Z94u62911LY09974698960030837FY88u71590q309XDHuj10X569747243LH5692209391721716%2BQH076WF-2.j24783232q343DH5171X54Z2X2qLH170868383_6j943BNH72q%22H1615850q25792993LH2527652786198981FHZ_686663094727UH8jT01vY739Z8524040k93LH01700080jk8_11%2BYku2286q537_58LH00092Z301019961701F-1.3u03166k658043D1.0406699127153762LH560976879q46656BV*Y141ZX698392614LH2646q47687861_FH74914u52896k31UH8jT01v1.0483Z95763X587LHk476892147u5642%2BH04q4q4q4q4q4LH032432432432432434FY9934991630416_2DH2985718785007952LH6283966624289706BNH72q%22QY%263.141474301700196U4.0773_vHX5563424q212785LY6441244338088321%2BOF2.1Z216639492104DY50327X25X51644LY5592382588573288BNY8646L0Jd!3)%5D)*OFH14951238Z465061DY2590149598j447XLY6704_1474989654%2BOF-1.4931155333046244D1.1650494256220822LH074k585213326ZBV*QH042342342342342u4FH5q2110X7395317DY765506714315u67LY664q21811469X9%2BH26W7LYq855855855855856FH415X08jj776216%231.0j948716108826LY09596149376420338BV)%5D~start!1718616519706~now!1718616821878~score!64~wholeGame!false)*)%2C%20BJ!0)%2C(%27type!%27RERACK%27~ballinfo!(%27balls!%5B(%27poDU4.91T0qvF~z!0)~angle!H0.J~z!0)~iL~y!Ns!(%27x!OY11261261261261261LH1W66P%2CHQY00X0X0X0X0X0XLS%2CYT25000000000U~power!VN1.179L0Jd!6)%5D)W57657657657657X45Y-HZ36_75j84k02q05u35v~poN%20(%27type!%27AIM%27~offset!(%27x!%22L0Jd!5)%5D)*%23U1.6211T1v%24Y9851416771k5912%25638Xu492834318%2606_6_6_6_6_7F%2BJ!0*%01%2B%26%25%24%23%22%20vuqkj_ZYXWVUTSQPONLJHFDB*_`

Expand Down

0 comments on commit 31b109e

Please sign in to comment.