@@ -19,7 +19,10 @@ import type { Piece } from "./nodes/Deck";
1919export interface Level {
2020 randomQubit : ( ) => Qubit ;
2121 deal : ( ) => Piece [ ] ;
22+ // Base multiplier for the score.
2223 scoreBase : number ;
24+ // Number needed to advance to the next level.
25+ count : number ;
2326}
2427
2528// TODO use this for more balanced dealing?
@@ -36,6 +39,7 @@ const gateRotations = [Math.PI / 2, Math.PI, Math.PI * (3 / 2)];
3639function primaryLevel ( axis : Axis ) : Level {
3740 return {
3841 scoreBase : 100 ,
42+ count : 16 ,
3943 randomQubit : ( ) => choice ( quartet ( axis ) ) ,
4044 deal : ( ) => {
4145 const random = ( ) => choice ( quartet ( axis ) ) ;
@@ -59,6 +63,7 @@ export const primaryLevels: Level[] = [
5963 primaryLevel ( "Z" ) ,
6064 {
6165 scoreBase : 150 ,
66+ count : 24 ,
6267 randomQubit : ( ) => choice ( qubitBases ) ,
6368 deal : ( ) => {
6469 const random = ( ) => choice ( qubitBases ) ;
@@ -80,6 +85,7 @@ export const primaryLevels: Level[] = [
8085function secondaryLevel ( axis : Axis ) : Level {
8186 return {
8287 scoreBase : 250 ,
88+ count : 20 ,
8389 randomQubit : ( ) => choice ( octet ( axis ) ) ,
8490 deal : ( ) => {
8591 const random = ( ) => choice ( octet ( axis ) ) ;
@@ -103,6 +109,7 @@ export const secondaryLevels: Level[] = [
103109 secondaryLevel ( "Z" ) ,
104110 {
105111 scoreBase : 300 ,
112+ count : 28 ,
106113 randomQubit : ( ) => choice ( secondaryQubits ) ,
107114 deal : ( ) => {
108115 const random = ( ) => choice ( secondaryQubits ) ;
@@ -123,6 +130,7 @@ export const secondaryLevels: Level[] = [
123130
124131export const freeMode : Level = {
125132 scoreBase : 500 ,
133+ count : 16 ,
126134 randomQubit : ( ) => randomQubit ( ) ,
127135 deal : ( ) => {
128136 let buffer = [ ] ;
@@ -142,6 +150,7 @@ export const freeMode: Level = {
142150export const campaign : Level [ ] = [
143151 {
144152 scoreBase : 50 ,
153+ count : 12 ,
145154 randomQubit : ( ) => choice ( [ ZERO , ONE ] ) ,
146155 deal : ( ) => {
147156 const random = ( ) => choice ( [ ZERO , ONE ] ) ;
0 commit comments