Skip to content

Commit

Permalink
Update to v1 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
geaz authored Apr 9, 2024
1 parent 3fc9ce0 commit 1b85e82
Show file tree
Hide file tree
Showing 8 changed files with 431 additions and 378 deletions.
473 changes: 111 additions & 362 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"build-simulator": "npx tsc --project ./tsconfig.simulator.json",
"run-simulator": "node ./build/simulator.js"
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
Expand Down
Binary file modified public/Tablora Rasa.pdf
Binary file not shown.
Binary file modified rules/Tablora Rasa.afpub
Binary file not shown.
276 changes: 276 additions & 0 deletions rules/Tablora Rasa.md

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions simulator/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions simulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"simulate-events": "node -e \"require('./build/simulator/simulator.js').simulateEvents()\"",
"simulate-question": "node -e \"require('./build/simulator/simulator.js').simulateQuestion()\"",
"simulate-likely": "node -e \"require('./build/simulator/simulator.js').simulateQuestion(true)\""
},
"devDependencies": {
"typescript": "^5.4.4"
}
}

25 changes: 12 additions & 13 deletions simulator/simulator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { MinorArcana } from "../src/model/MinorArcana";
import { Card, CardOrientation } from "../src/model/CardDeck";
import { isCourt } from "../src/model/Arcana";
import { QuestionResult, Event, checkEvent, checkLikely, checkYesNo } from "../src/QuestionChecker";

let minorPile: Array<Card> = MinorArcana.map(c => { return {
Expand Down Expand Up @@ -57,15 +56,15 @@ export function simulateQuestion(likely: boolean) {
}
}

console.log(`Total Yes: ${yes} (${(yes/1000000).toFixed(2)}%)`);
console.log(`Total Yes, but: ${yesBut} (${(yesBut/1000000).toFixed(2)}%)`);
console.log(`Total Yes, and: ${yesAnd} (${(yesAnd/1000000).toFixed(2)}%)`);
console.log(`Total No, but: ${noBut} (${(noBut/1000000).toFixed(2)}%)`);
console.log(`Total No, and: ${noAnd} (${(noAnd/1000000).toFixed(2)}%)`);
console.log(`Total No: ${no} (${(no/1000000).toFixed(2)}%)`);
console.log(`Total Yes: ${yes} (${(yes/1000000).toFixed(2)})`);
console.log(`Total Yes, but: ${yesBut} (${(yesBut/1000000).toFixed(2)})`);
console.log(`Total Yes, and: ${yesAnd} (${(yesAnd/1000000).toFixed(2)})`);
console.log(`Total No, but: ${noBut} (${(noBut/1000000).toFixed(2)})`);
console.log(`Total No, and: ${noAnd} (${(noAnd/1000000).toFixed(2)})`);
console.log(`Total No: ${no} (${(no/1000000).toFixed(2)})`);
console.log(``);
console.log(`All Yes Types: ${yes+yesBut+yesAnd} (${((yes+yesBut+yesAnd)/1000000).toFixed(2)}%)`);
console.log(`All No Types: ${no+noBut+noAnd} (${((no+noBut+noAnd)/1000000).toFixed(2)}%)`);
console.log(`All Yes Types: ${yes+yesBut+yesAnd} (${((yes+yesBut+yesAnd)/1000000).toFixed(2)})`);
console.log(`All No Types: ${no+noBut+noAnd} (${((no+noBut+noAnd)/1000000).toFixed(2)})`);
}

export function simulateEvents() {
Expand Down Expand Up @@ -100,10 +99,10 @@ export function simulateEvents() {
}
}

console.log(`Total triggered NPCs: ${triggeredNpcs} (${(triggeredNpcs/1000000).toFixed(2)}%)`);
console.log(`Total triggered Encounters: ${triggeredEncounters} (${(triggeredEncounters/1000000).toFixed(2)}%)`);
console.log(`Total triggered Locations: ${triggeredLocations} (${(triggeredLocations/1000000).toFixed(2)}%)`);
console.log(`Total triggered Notes: ${triggeredNotes} (${(triggeredNotes/1000000).toFixed(2)}%)`);
console.log(`Total triggered NPCs: ${triggeredNpcs} (${(triggeredNpcs/1000000).toFixed(2)})`);
console.log(`Total triggered Encounters: ${triggeredEncounters} (${(triggeredEncounters/1000000).toFixed(2)})`);
console.log(`Total triggered Locations: ${triggeredLocations} (${(triggeredLocations/1000000).toFixed(2)})`);
console.log(`Total triggered Notes: ${triggeredNotes} (${(triggeredNotes/1000000).toFixed(2)})`);
}

export function simulateEventTrigger(cardDraws: number) {
Expand Down

0 comments on commit 1b85e82

Please sign in to comment.