From 41ef1ba818397e1703a4a93dc79c8ff6aeb9d3dd Mon Sep 17 00:00:00 2001 From: Lyndon Stolton Date: Sun, 27 Aug 2023 17:40:30 +0100 Subject: [PATCH 01/23] Added Rust version of 43_Hammurabi --- 43_Hammurabi/rust/Cargo.toml | 9 ++ 43_Hammurabi/rust/README.md | 3 + 43_Hammurabi/rust/src/main.rs | 258 ++++++++++++++++++++++++++++++++++ 3 files changed, 270 insertions(+) create mode 100644 43_Hammurabi/rust/Cargo.toml create mode 100644 43_Hammurabi/rust/README.md create mode 100644 43_Hammurabi/rust/src/main.rs diff --git a/43_Hammurabi/rust/Cargo.toml b/43_Hammurabi/rust/Cargo.toml new file mode 100644 index 00000000..3b1d02f5 --- /dev/null +++ b/43_Hammurabi/rust/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "rust" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.8.5" diff --git a/43_Hammurabi/rust/README.md b/43_Hammurabi/rust/README.md new file mode 100644 index 00000000..fc6468b9 --- /dev/null +++ b/43_Hammurabi/rust/README.md @@ -0,0 +1,3 @@ +Original source downloaded [from Vintage Basic](http://www.vintage-basic.net/games.html) + +Conversion to [Rust](https://www.rust-lang.org/) diff --git a/43_Hammurabi/rust/src/main.rs b/43_Hammurabi/rust/src/main.rs new file mode 100644 index 00000000..bba41247 --- /dev/null +++ b/43_Hammurabi/rust/src/main.rs @@ -0,0 +1,258 @@ +use std::io; +use rand::Rng; + +fn run() { + let mut year = 0; + let mut population = 95; + let mut immigrants = 5; + let mut starved = 0; + let mut total_starved = 0; + let mut plague = false; + let mut grain = 2800; + let mut bushels_fed; + let mut harvest; + let mut planted; + let mut yield_acre = 3; + let mut eaten_rats = 200; + let mut acres = 1000; + let mut land_price; + let mut bought_land; + let mut perc_starved = 0.0; + let mut game_failed = false; + + 'main: loop { + year += 1; + if year > 11 { + break; + } + println!("\n\n\nHAMURABI: I BEG TO REPORT TO YOU,"); + println!("IN YEAR {year}, {starved} PEOPLE STARVED, {immigrants} CAME TO THE CITY,"); + population = population + immigrants; + if plague{ + population = population / 2; + plague = false; + println!("A HORRIBLE PLAGUE STRUCK! HALF THE PEOPLE DIED."); + } + println!("POPULATION IS NOW {population}"); + println!("THE CITY NOW OWNS {acres} ACRES."); + println!("YOU HARVESTED {yield_acre} BUSHELS PER ACRE."); + println!("THE RATS ATE {eaten_rats} BUSHELS."); + println!("YOU NOW HAVE {grain} BUSHELS IN STORE.\n"); + let r = rand::thread_rng().gen_range(1..10); + land_price = r + 17; + println!("LAND IS TRADING AT {land_price} BUSHELS PER ACRE."); + + loop { + println!("HOW MANY ACRES DO YOU WISH TO BUY? "); + if let Some(qty) = get_input() { + if qty < 0 { + impossible_task(); + game_failed = true; + break 'main; + } + if qty == 0 { + bought_land = false; + break; + } + if land_price * qty as u32 > grain { + insufficient_grain(grain); + continue; + } + if land_price * qty as u32 <= grain { + acres += qty as u32; + grain -= land_price * qty as u32; + bought_land = true; + break; + } + } + } + + if bought_land == false { + loop { + println!("HOW MANY ACRES DO YOU WISH TO SELL? "); + if let Some(qty) = get_input() { + if qty < 0 { + impossible_task(); + game_failed = true; + break 'main; + } + if qty as u32 <= acres { + acres -= qty as u32; + grain += land_price * qty as u32; + break; + } + insufficient_land(acres); + } + } + } + + loop { + println!("HOW MANY BUSHELS DO YOU WISH TO FEED YOUR PEOPLE? "); + if let Some(qty) = get_input() { + if qty < 0 { + impossible_task(); + game_failed = true; + break 'main; + } + // Trying to use more grain than is in silos? + if qty as u32 > grain { + insufficient_grain(grain); + continue; + } + bushels_fed = qty as u32; + grain -= bushels_fed; + break; + } + } + + loop { + println!("HOW MANY ACRES DO YOU WISH TO PLANT WITH SEED? "); + if let Some(qty) = get_input() { + if qty < 0 { + impossible_task(); + game_failed = true; + break 'main; + } + // Trying to plant more acres than you own? + if qty as u32 > acres { + insufficient_land(acres); + continue; + } + // Enough grain for seed? + if qty as u32 / 2 > grain { + insufficient_grain(grain); + continue; + } + // Enough people to tend the crops? + if qty as u32 > (10 * population) { + insufficient_people(population); + continue; + } + planted = qty as u32; + grain = grain - (planted / 2); + break; + } + } + + // A bountiful harvest! + yield_acre = gen_random(); + harvest = planted * yield_acre; + eaten_rats = 0; + + // Determine if any grain was eaten by rats + let mut c = gen_random(); + if c % 2 == 0 { // If c is even... + // Rats are running wild! + eaten_rats = grain / c; + } + // Update the amount of grain held + grain = grain - eaten_rats + harvest; + + // Let's have some babies + c = gen_random(); + immigrants = c * (20 * acres + grain) / population / 100 + 1; + + // How many people had full tummies? + c = bushels_fed / 20; + // Horrors, a 15% chance of plague + let rf: f32 = rand::thread_rng().gen(); + let plague_chance = (10. * ((2. * rf) - 0.3)) as i32; + if plague_chance == 0 { + plague = true; + } + if population >= c { + // Starve enough for impeachment? + starved = population - c; + if starved > (0.45 * population as f32) as u32 { + println!("YOU STARVED {starved} PEOPLE IN ONE YEAR!!!"); + national_fink(); + game_failed = true; + break; + } + // Calculate percentages here + perc_starved = ((year - 1) as f32 * perc_starved + starved as f32 * 100. / population as f32) / year as f32; + population = c; + total_starved = total_starved + starved; + } + } + + if game_failed == false { + println!("IN YOUR 10-YEAR TERM OF OFFICE {perc_starved} PERCENT OF THE"); + println!("POPULATION STARVED PER YEAR ON THE AVERAGE, I.E. A TOTAL OF"); + println!("{total_starved} PEOPLE DIED!!"); + let acres_head = acres / population; + println!("YOU STARTED WITH 10 ACRES PER PERSON AND ENDED WITH"); + println!("{acres_head} ACRES PER PERSON.\n"); + if perc_starved > 33. || acres_head < 7 { + national_fink(); + } + else if perc_starved > 10. || acres_head < 9 { + println!("YOUR HEAVY-HANDED PERFORMANCE SMACKS OF NERO AND IVAN IV."); + println!("THE PEOPLE (REMAINING) FIND YOU AND UNPLEASANT RULER, AND,"); + println!("FRANKLY, HATE YOUR GUTS!!"); + } + else if perc_starved > 3. || acres_head < 10 { + let haters = (population as f32 * 0.8 * gen_random() as f32) as u32; + println!("YOUR PERFORMANCE COULD HAVE BEEN SOMEWHAT BETTER, BUT"); + println!("REALLY WASN'T TOO BAD AT ALL. {haters} PEOPLE"); + println!("WOULD DEARLY LIKE TO SEE YOU ASSASSINATED BUT WE ALL HAVE OUR"); + println!("TRIVIAL PROBLEMS."); + } else { + println!("A FANTASTIC PERFORMANCE!!! CHARLEMANGE, DISRAELI, AND"); + println!("JEFFERSON COMBINED COULD NOT HAVE DONE BETTER!\n"); + } + for _ in 1..10 { + print!("\n"); + } + } + + println!("\nSO LONG FOR NOW.\n"); +} + +fn get_input() -> Option { + let mut input = String::new(); + io::stdin().read_line(&mut input).expect("Failed read_line"); + match input.trim().parse() { + Ok(num) => Some(num), + Err(_) => None, + } +} + +fn gen_random() -> u32 { + let r: f32 = rand::thread_rng().gen(); + (r * 5.0 + 1.0) as u32 +} + +fn impossible_task() { + println!("HAMURABI: I CANNOT DO WHAT YOU WISH."); + println!("GET YOURSELF ANOTHER STEWARD!!!!!"); +} + +fn insufficient_grain(grain: u32) { + println!("HAMURABI: THINK AGAIN. YOU HAVE ONLY"); + println!("{grain} BUSHELS OF GRAIN. NOW THEN,"); +} + +fn insufficient_land(acres: u32) { + println!("HAMURABI: THINK AGAIN. YOU OWN ONLY {acres} ACRES. NOW THEN,"); +} + +fn insufficient_people(population: u32) { + println!("BUT YOU HAVE ONLY {population} PEOPLE TO TEND THE FIELDS! NOW THEN,"); +} + +fn national_fink() { + println!("DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ONLY"); + println!("BEEN IMPEACHED AND THROWN OUT OF OFFICE BUT YOU HAVE"); + println!("ALSO BEEN DECLARED NATIONAL FINK!!!!"); +} + +fn main() { + println!(" HAMURABI"); + println!("CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"); + print!("\n\n\n\n"); + println!("TRY YOUR HAND AT GOVERNING ANCIENT SUMERIA"); + println!("FOR A TEN-YEAR TERM OF OFFICE.\n"); + + run(); +} From 6555d1cf2d0e6895bc26206519c55b4107b0b11f Mon Sep 17 00:00:00 2001 From: Lyndon Stolton Date: Sun, 27 Aug 2023 21:13:26 +0100 Subject: [PATCH 02/23] Minor changes to 43_Hammurabi/rust - Minor changes to make code more idiomatic (clippy no longer has any issues), no functional changes - Added some additional comments to make code easier to follow --- 43_Hammurabi/rust/src/main.rs | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/43_Hammurabi/rust/src/main.rs b/43_Hammurabi/rust/src/main.rs index bba41247..061d502e 100644 --- a/43_Hammurabi/rust/src/main.rs +++ b/43_Hammurabi/rust/src/main.rs @@ -2,6 +2,7 @@ use std::io; use rand::Rng; fn run() { + // Set up variables let mut year = 0; let mut population = 95; let mut immigrants = 5; @@ -27,9 +28,9 @@ fn run() { } println!("\n\n\nHAMURABI: I BEG TO REPORT TO YOU,"); println!("IN YEAR {year}, {starved} PEOPLE STARVED, {immigrants} CAME TO THE CITY,"); - population = population + immigrants; + population += immigrants; if plague{ - population = population / 2; + population /= 2; plague = false; println!("A HORRIBLE PLAGUE STRUCK! HALF THE PEOPLE DIED."); } @@ -45,19 +46,22 @@ fn run() { loop { println!("HOW MANY ACRES DO YOU WISH TO BUY? "); if let Some(qty) = get_input() { - if qty < 0 { + if qty < 0 { // A negative amount is impossible impossible_task(); game_failed = true; break 'main; } + // Player decides not to buy any land if qty == 0 { bought_land = false; break; } + // Trying to buy more land than you can afford? if land_price * qty as u32 > grain { insufficient_grain(grain); continue; } + // Everything checks out OK if land_price * qty as u32 <= grain { acres += qty as u32; grain -= land_price * qty as u32; @@ -67,20 +71,22 @@ fn run() { } } - if bought_land == false { + if !bought_land { loop { println!("HOW MANY ACRES DO YOU WISH TO SELL? "); if let Some(qty) = get_input() { - if qty < 0 { + if qty < 0 { // A negative amount is impossible impossible_task(); game_failed = true; break 'main; } + // Everything checks out OK if qty as u32 <= acres { acres -= qty as u32; grain += land_price * qty as u32; break; } + // Trying to sell more land that you own insufficient_land(acres); } } @@ -89,7 +95,7 @@ fn run() { loop { println!("HOW MANY BUSHELS DO YOU WISH TO FEED YOUR PEOPLE? "); if let Some(qty) = get_input() { - if qty < 0 { + if qty < 0 { // A negative amount is impossible impossible_task(); game_failed = true; break 'main; @@ -99,6 +105,7 @@ fn run() { insufficient_grain(grain); continue; } + // Everything checks out OK bushels_fed = qty as u32; grain -= bushels_fed; break; @@ -108,7 +115,7 @@ fn run() { loop { println!("HOW MANY ACRES DO YOU WISH TO PLANT WITH SEED? "); if let Some(qty) = get_input() { - if qty < 0 { + if qty < 0 { // A negative amount is impossible impossible_task(); game_failed = true; break 'main; @@ -128,8 +135,9 @@ fn run() { insufficient_people(population); continue; } + // Everything checks out OK planted = qty as u32; - grain = grain - (planted / 2); + grain -= planted / 2; break; } } @@ -169,14 +177,14 @@ fn run() { game_failed = true; break; } - // Calculate percentages here + // Calculate percentage of people that starved per year on average perc_starved = ((year - 1) as f32 * perc_starved + starved as f32 * 100. / population as f32) / year as f32; population = c; - total_starved = total_starved + starved; + total_starved += starved; } } - if game_failed == false { + if !game_failed { println!("IN YOUR 10-YEAR TERM OF OFFICE {perc_starved} PERCENT OF THE"); println!("POPULATION STARVED PER YEAR ON THE AVERAGE, I.E. A TOTAL OF"); println!("{total_starved} PEOPLE DIED!!"); @@ -202,7 +210,7 @@ fn run() { println!("JEFFERSON COMBINED COULD NOT HAVE DONE BETTER!\n"); } for _ in 1..10 { - print!("\n"); + println!(); } } From adba99e76784676491847cbbe827025560525113 Mon Sep 17 00:00:00 2001 From: Guido Knips Date: Mon, 28 Aug 2023 20:29:46 +0200 Subject: [PATCH 03/23] Add documentation for tourist trade bug in King - really bad pollution can get positive money from tourists - fix issue in python implementation, other implementations still lack it --- 53_King/README.md | 15 +++++++++++++++ 53_King/python/king.py | 6 ++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/53_King/README.md b/53_King/README.md index 14a66fe9..83fb61c3 100644 --- a/53_King/README.md +++ b/53_King/README.md @@ -78,3 +78,18 @@ On basic line 1310 we see this: but it should probably be: 1310 IF J=0 THEN 1324 + +### Bug 5 + +On basic line 1390 the income from tourism is calculated: + +``` +1390 A=INT(A+Q) +1400 V1=INT(((B-P1)*22)+(RND(1)*500)) +1405 V2=INT((2000-D)*15) +1410 PRINT " YOU MADE";ABS(INT(V1-V2));"RALLODS FROM TOURIST TRADE." +``` + +It is very easily possible that `V2` is larger than `V1` e.g. if all of the land has been sold. In the original game this does not make a difference because of Bug 1 (see above). + +However, judging by how `V1` and `V2` are handled in the code, it looks like `V1` is the basic income from tourism and `V2` is a deduction for pollution. When `ABS(INT(V1-V2))` is used as earnings from tourism, the player actually _gets_ money for a large enough pollution. So a better solution would be to let `V1 - V2` cap out at 0, so once the pollution is large enough, there is no income from tourists anymore. diff --git a/53_King/python/king.py b/53_King/python/king.py index 9c8d075c..a4d9b769 100644 --- a/53_King/python/king.py +++ b/53_King/python/king.py @@ -61,7 +61,7 @@ class GameState: return self.countrymen - self.population_change def sell_land(self, amount: int) -> None: - assert amount < self.farmland + assert amount <= self.farmland self.land -= amount self.rallods += self.land_buy_price * amount @@ -126,7 +126,9 @@ class GameState: def handle_tourist_trade(self) -> None: V1 = int(self.settled_people * 22 + random() * 500) V2 = int((INITIAL_LAND - self.land) * 15) - tourist_trade_earnings = int(V1 - V2) + tourist_trade_earnings = 0 + if V1 > V2: + tourist_trade_earnings = V1 - V2 print(f" YOU MADE {tourist_trade_earnings} RALLODS FROM TOURIST TRADE.") if V2 != 0 and not (V1 - V2 >= self.tourism_earnings): print(" DECREASE BECAUSE ") From be75ea138641daee992ed00ed1584b5b6b5685b9 Mon Sep 17 00:00:00 2001 From: Guido Knips Date: Mon, 28 Aug 2023 20:41:55 +0200 Subject: [PATCH 04/23] Fix pick of pollution reason in python King - was intended to pick only one random reason each time - picked up to five reasons - also removed bad line break --- 53_King/python/king.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/53_King/python/king.py b/53_King/python/king.py index a4d9b769..4bca76fa 100644 --- a/53_King/python/king.py +++ b/53_King/python/king.py @@ -131,17 +131,17 @@ class GameState: tourist_trade_earnings = V1 - V2 print(f" YOU MADE {tourist_trade_earnings} RALLODS FROM TOURIST TRADE.") if V2 != 0 and not (V1 - V2 >= self.tourism_earnings): - print(" DECREASE BECAUSE ") + print(" DECREASE BECAUSE ", end="") reason = randint(0, 10) if reason <= 2: print("FISH POPULATION HAS DWINDLED DUE TO WATER POLLUTION.") - if reason <= 4: + elif reason <= 4: print("AIR POLLUTION IS KILLING GAME BIRD POPULATION.") - if reason <= 6: + elif reason <= 6: print("MINERAL BATHS ARE BEING RUINED BY WATER POLLUTION.") - if reason <= 8: + elif reason <= 8: print("UNPLEASANT SMOG IS DISCOURAGING SUN BATHERS.") - if reason <= 10: + else: print("HOTELS ARE LOOKING SHABBY DUE TO SMOG GRIT.") # NOTE: The following two lines had a bug in the original game: From fa4f6888ddabea2b3d1fe86d2d5393b2b66b0cb6 Mon Sep 17 00:00:00 2001 From: Guido Knips Date: Mon, 28 Aug 2023 20:57:27 +0200 Subject: [PATCH 05/23] Fix flake8 issues in acey ducey - came seemingly out of nowhere and broke my totally unrelated PR --- 01_Acey_Ducey/python/acey_ducey.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/01_Acey_Ducey/python/acey_ducey.py b/01_Acey_Ducey/python/acey_ducey.py index 8e353569..75a1eac2 100755 --- a/01_Acey_Ducey/python/acey_ducey.py +++ b/01_Acey_Ducey/python/acey_ducey.py @@ -6,6 +6,7 @@ https://www.atariarchives.org/basicgames/showpage.php?page=2 import random + cards = { 2: "2", 3: "3", @@ -22,18 +23,19 @@ cards = { 14: "Ace", } + def play_game() -> None: cash = 100 while cash > 0: print(f"You now have {cash} dollars\n") print("Here are you next two cards") - round_cards = list(cards.keys()) # gather cards from dictionary - card_a = random.choice(round_cards) # choose a card - card_b = card_a # clone the first card, so we avoid the same number for the second card - while (card_a == card_b): # if the cards are the same, choose another card + round_cards = list(cards.keys()) # gather cards from dictionary + card_a = random.choice(round_cards) # choose a card + card_b = card_a # clone the first card, so we avoid the same number for the second card + while (card_a == card_b): # if the cards are the same, choose another card card_b = random.choice(round_cards) - card_c = random.choice(round_cards) # choose last card - if card_a > card_b: # swap cards if card_a is greater than card_b + card_c = random.choice(round_cards) # choose last card + if card_a > card_b: # swap cards if card_a is greater than card_b card_a, card_b = card_b, card_a print(f" {cards[card_a]}") print(f" {cards[card_b]}\n") From 7a62098e94aa5278f9e1b038966862f72b8d4353 Mon Sep 17 00:00:00 2001 From: Guido Knips Date: Mon, 28 Aug 2023 21:06:35 +0200 Subject: [PATCH 06/23] Un-ignore Cargo.lock Official cargo documentation says Cargo.lock should be under version control for binaries (but not for libraries) see https://doc.rust-lang.org/cargo/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries --- .gitignore | 1 - 01_Acey_Ducey/rust/Cargo.lock | 75 +++++++++++ 02_Amazing/rust/Cargo.lock | 75 +++++++++++ 03_Animal/rust/Cargo.lock | 7 + 04_Awari/rust/Cargo.lock | 75 +++++++++++ 05_Bagels/rust/Cargo.lock | 75 +++++++++++ 10_Blackjack/rust/Cargo.lock | 75 +++++++++++ 11_Bombardment/rust/Cargo.lock | 82 ++++++++++++ 18_Bullseye/rust/Cargo.lock | 75 +++++++++++ 20_Buzzword/rust/Cargo.lock | 75 +++++++++++ 21_Calendar/rust/Cargo.lock | 7 + 22_Change/rust/Cargo.lock | 7 + 24_Chemist/rust/Cargo.lock | 75 +++++++++++ 25_Chief/rust/Cargo.lock | 7 + 29_Craps/rust/Cargo.lock | 75 +++++++++++ 30_Cube/rust/Cargo.lock | 75 +++++++++++ 32_Diamond/rust/Cargo.lock | 7 + 33_Dice/rust/Cargo.lock | 75 +++++++++++ 35_Even_Wins/rust/Cargo.lock | 7 + 36_Flip_Flop/rust/Cargo.lock | 82 ++++++++++++ 41_Guess/rust/Cargo.lock | 75 +++++++++++ 43_Hammurabi/rust/Cargo.lock | 75 +++++++++++ 47_Hi-Lo/rust/Cargo.lock | 75 +++++++++++ 50_Horserace/rust/Cargo.lock | 75 +++++++++++ 51_Hurkle/rust/Cargo.lock | 75 +++++++++++ 54_Letter/rust/Cargo.lock | 75 +++++++++++ 55_Life/rust/Cargo.lock | 7 + 57_Literature_Quiz/rust/Cargo.lock | 7 + 58_Love/rust/Cargo.lock | 7 + 61_Math_Dice/rust/Cargo.lock | 75 +++++++++++ 62_Mugwump/rust/Cargo.lock | 75 +++++++++++ 64_Nicomachus/rust/Cargo.lock | 7 + 65_Nim/rust/Cargo.lock | 23 ++++ 66_Number/rust/Cargo.lock | 75 +++++++++++ 68_Orbit/rust/Cargo.lock | 75 +++++++++++ 72_Queen/rust/Cargo.lock | 75 +++++++++++ 74_Rock_Scissors_Paper/rust/Cargo.lock | 91 +++++++++++++ 75_Roulette/rust/Cargo.lock | 82 ++++++++++++ 76_Russian_Roulette/rust/Cargo.lock | 75 +++++++++++ 78_Sine_Wave/rust/Cargo.lock | 7 + 81_Splat/rust/Cargo.lock | 75 +++++++++++ 82_Stars/rust/Cargo.lock | 75 +++++++++++ 84_Super_Star_Trek/rust/Cargo.lock | 169 +++++++++++++++++++++++++ 85_Synonym/rust/Cargo.lock | 75 +++++++++++ 89_Tic-Tac-Toe/rust/Cargo.lock | 7 + 90_Tower/rust/Cargo.lock | 7 + 91_Train/rust/Cargo.lock | 75 +++++++++++ 92_Trap/rust/Cargo.lock | 75 +++++++++++ 94_War/rust/Cargo.lock | 75 +++++++++++ 95_Weekday/rust/Cargo.lock | 7 + 96_Word/rust/Cargo.lock | 75 +++++++++++ 51 files changed, 2877 insertions(+), 1 deletion(-) create mode 100644 01_Acey_Ducey/rust/Cargo.lock create mode 100644 02_Amazing/rust/Cargo.lock create mode 100644 03_Animal/rust/Cargo.lock create mode 100644 04_Awari/rust/Cargo.lock create mode 100644 05_Bagels/rust/Cargo.lock create mode 100644 10_Blackjack/rust/Cargo.lock create mode 100644 11_Bombardment/rust/Cargo.lock create mode 100644 18_Bullseye/rust/Cargo.lock create mode 100644 20_Buzzword/rust/Cargo.lock create mode 100644 21_Calendar/rust/Cargo.lock create mode 100644 22_Change/rust/Cargo.lock create mode 100644 24_Chemist/rust/Cargo.lock create mode 100644 25_Chief/rust/Cargo.lock create mode 100644 29_Craps/rust/Cargo.lock create mode 100644 30_Cube/rust/Cargo.lock create mode 100644 32_Diamond/rust/Cargo.lock create mode 100644 33_Dice/rust/Cargo.lock create mode 100644 35_Even_Wins/rust/Cargo.lock create mode 100644 36_Flip_Flop/rust/Cargo.lock create mode 100644 41_Guess/rust/Cargo.lock create mode 100644 43_Hammurabi/rust/Cargo.lock create mode 100644 47_Hi-Lo/rust/Cargo.lock create mode 100644 50_Horserace/rust/Cargo.lock create mode 100644 51_Hurkle/rust/Cargo.lock create mode 100644 54_Letter/rust/Cargo.lock create mode 100644 55_Life/rust/Cargo.lock create mode 100644 57_Literature_Quiz/rust/Cargo.lock create mode 100644 58_Love/rust/Cargo.lock create mode 100644 61_Math_Dice/rust/Cargo.lock create mode 100644 62_Mugwump/rust/Cargo.lock create mode 100644 64_Nicomachus/rust/Cargo.lock create mode 100644 65_Nim/rust/Cargo.lock create mode 100644 66_Number/rust/Cargo.lock create mode 100644 68_Orbit/rust/Cargo.lock create mode 100644 72_Queen/rust/Cargo.lock create mode 100644 74_Rock_Scissors_Paper/rust/Cargo.lock create mode 100644 75_Roulette/rust/Cargo.lock create mode 100644 76_Russian_Roulette/rust/Cargo.lock create mode 100644 78_Sine_Wave/rust/Cargo.lock create mode 100644 81_Splat/rust/Cargo.lock create mode 100644 82_Stars/rust/Cargo.lock create mode 100644 84_Super_Star_Trek/rust/Cargo.lock create mode 100644 85_Synonym/rust/Cargo.lock create mode 100644 89_Tic-Tac-Toe/rust/Cargo.lock create mode 100644 90_Tower/rust/Cargo.lock create mode 100644 91_Train/rust/Cargo.lock create mode 100644 92_Trap/rust/Cargo.lock create mode 100644 94_War/rust/Cargo.lock create mode 100644 95_Weekday/rust/Cargo.lock create mode 100644 96_Word/rust/Cargo.lock diff --git a/.gitignore b/.gitignore index 2243de05..e28f8fe0 100644 --- a/.gitignore +++ b/.gitignore @@ -34,7 +34,6 @@ venv/ .DS_Store .vs/ **/target/ -Cargo.lock **/*.rs.bk /target todo.md diff --git a/01_Acey_Ducey/rust/Cargo.lock b/01_Acey_Ducey/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/01_Acey_Ducey/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/02_Amazing/rust/Cargo.lock b/02_Amazing/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/02_Amazing/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/03_Animal/rust/Cargo.lock b/03_Animal/rust/Cargo.lock new file mode 100644 index 00000000..9c4ba014 --- /dev/null +++ b/03_Animal/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "animal" +version = "0.1.0" diff --git a/04_Awari/rust/Cargo.lock b/04_Awari/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/04_Awari/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/05_Bagels/rust/Cargo.lock b/05_Bagels/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/05_Bagels/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/10_Blackjack/rust/Cargo.lock b/10_Blackjack/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/10_Blackjack/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/11_Bombardment/rust/Cargo.lock b/11_Bombardment/rust/Cargo.lock new file mode 100644 index 00000000..81365033 --- /dev/null +++ b/11_Bombardment/rust/Cargo.lock @@ -0,0 +1,82 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "morristown" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83b191fd96370b91c2925125774011a7a0f69b4db9e2045815e4fd20af725f6" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "morristown", + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/18_Bullseye/rust/Cargo.lock b/18_Bullseye/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/18_Bullseye/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/20_Buzzword/rust/Cargo.lock b/20_Buzzword/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/20_Buzzword/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/21_Calendar/rust/Cargo.lock b/21_Calendar/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/21_Calendar/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/22_Change/rust/Cargo.lock b/22_Change/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/22_Change/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/24_Chemist/rust/Cargo.lock b/24_Chemist/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/24_Chemist/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/25_Chief/rust/Cargo.lock b/25_Chief/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/25_Chief/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/29_Craps/rust/Cargo.lock b/29_Craps/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/29_Craps/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/30_Cube/rust/Cargo.lock b/30_Cube/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/30_Cube/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/32_Diamond/rust/Cargo.lock b/32_Diamond/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/32_Diamond/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/33_Dice/rust/Cargo.lock b/33_Dice/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/33_Dice/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/35_Even_Wins/rust/Cargo.lock b/35_Even_Wins/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/35_Even_Wins/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/36_Flip_Flop/rust/Cargo.lock b/36_Flip_Flop/rust/Cargo.lock new file mode 100644 index 00000000..81365033 --- /dev/null +++ b/36_Flip_Flop/rust/Cargo.lock @@ -0,0 +1,82 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "morristown" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83b191fd96370b91c2925125774011a7a0f69b4db9e2045815e4fd20af725f6" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "morristown", + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/41_Guess/rust/Cargo.lock b/41_Guess/rust/Cargo.lock new file mode 100644 index 00000000..5329dedd --- /dev/null +++ b/41_Guess/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guess" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/43_Hammurabi/rust/Cargo.lock b/43_Hammurabi/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/43_Hammurabi/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/47_Hi-Lo/rust/Cargo.lock b/47_Hi-Lo/rust/Cargo.lock new file mode 100644 index 00000000..937c07c6 --- /dev/null +++ b/47_Hi-Lo/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/50_Horserace/rust/Cargo.lock b/50_Horserace/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/50_Horserace/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/51_Hurkle/rust/Cargo.lock b/51_Hurkle/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/51_Hurkle/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/54_Letter/rust/Cargo.lock b/54_Letter/rust/Cargo.lock new file mode 100644 index 00000000..6a34e6ec --- /dev/null +++ b/54_Letter/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "letter" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/55_Life/rust/Cargo.lock b/55_Life/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/55_Life/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/57_Literature_Quiz/rust/Cargo.lock b/57_Literature_Quiz/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/57_Literature_Quiz/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/58_Love/rust/Cargo.lock b/58_Love/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/58_Love/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/61_Math_Dice/rust/Cargo.lock b/61_Math_Dice/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/61_Math_Dice/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/62_Mugwump/rust/Cargo.lock b/62_Mugwump/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/62_Mugwump/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/64_Nicomachus/rust/Cargo.lock b/64_Nicomachus/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/64_Nicomachus/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/65_Nim/rust/Cargo.lock b/65_Nim/rust/Cargo.lock new file mode 100644 index 00000000..fc74a49e --- /dev/null +++ b/65_Nim/rust/Cargo.lock @@ -0,0 +1,23 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "nanorand" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "729eb334247daa1803e0a094d0a5c55711b85571179f5ec6e53eccfdf7008958" + +[[package]] +name = "nim" +version = "1.0.0" +dependencies = [ + "nanorand", + "text_io", +] + +[[package]] +name = "text_io" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f0c8eb2ad70c12a6a69508f499b3051c924f4b1cfeae85bfad96e6bc5bba46" diff --git a/66_Number/rust/Cargo.lock b/66_Number/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/66_Number/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/68_Orbit/rust/Cargo.lock b/68_Orbit/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/68_Orbit/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/72_Queen/rust/Cargo.lock b/72_Queen/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/72_Queen/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/74_Rock_Scissors_Paper/rust/Cargo.lock b/74_Rock_Scissors_Paper/rust/Cargo.lock new file mode 100644 index 00000000..81a95200 --- /dev/null +++ b/74_Rock_Scissors_Paper/rust/Cargo.lock @@ -0,0 +1,91 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "nanorand" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "729eb334247daa1803e0a094d0a5c55711b85571179f5ec6e53eccfdf7008958" + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rock_scissors_paper" +version = "1.0.0" +dependencies = [ + "nanorand", + "strum", + "strum_macros", + "text_io", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "text_io" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f0c8eb2ad70c12a6a69508f499b3051c924f4b1cfeae85bfad96e6bc5bba46" + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" diff --git a/75_Roulette/rust/Cargo.lock b/75_Roulette/rust/Cargo.lock new file mode 100644 index 00000000..81365033 --- /dev/null +++ b/75_Roulette/rust/Cargo.lock @@ -0,0 +1,82 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "morristown" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83b191fd96370b91c2925125774011a7a0f69b4db9e2045815e4fd20af725f6" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "morristown", + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/76_Russian_Roulette/rust/Cargo.lock b/76_Russian_Roulette/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/76_Russian_Roulette/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/78_Sine_Wave/rust/Cargo.lock b/78_Sine_Wave/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/78_Sine_Wave/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/81_Splat/rust/Cargo.lock b/81_Splat/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/81_Splat/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/82_Stars/rust/Cargo.lock b/82_Stars/rust/Cargo.lock new file mode 100644 index 00000000..b13b873b --- /dev/null +++ b/82_Stars/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "stars" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/84_Super_Star_Trek/rust/Cargo.lock b/84_Super_Star_Trek/rust/Cargo.lock new file mode 100644 index 00000000..71bbf0c8 --- /dev/null +++ b/84_Super_Star_Trek/rust/Cargo.lock @@ -0,0 +1,169 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "ctrlc" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a011bbe2c35ce9c1f143b7af6f94f29a167beb4cd1d29e6740ce836f723120e" +dependencies = [ + "nix", + "windows-sys", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "nix" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abbbc55ad7b13aac85f9401c796dcda1b864e07fcad40ad47792eaa8932ea502" +dependencies = [ + "bitflags", + "cfg-if", + "libc", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "ctrlc", + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" diff --git a/85_Synonym/rust/Cargo.lock b/85_Synonym/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/85_Synonym/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/89_Tic-Tac-Toe/rust/Cargo.lock b/89_Tic-Tac-Toe/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/89_Tic-Tac-Toe/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/90_Tower/rust/Cargo.lock b/90_Tower/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/90_Tower/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/91_Train/rust/Cargo.lock b/91_Train/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/91_Train/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/92_Trap/rust/Cargo.lock b/92_Trap/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/92_Trap/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/94_War/rust/Cargo.lock b/94_War/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/94_War/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/95_Weekday/rust/Cargo.lock b/95_Weekday/rust/Cargo.lock new file mode 100644 index 00000000..b21cc6a2 --- /dev/null +++ b/95_Weekday/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/96_Word/rust/Cargo.lock b/96_Word/rust/Cargo.lock new file mode 100644 index 00000000..4fe2abbe --- /dev/null +++ b/96_Word/rust/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rust" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" From 4f70fa315b4b30222066e70488570f36c7936a39 Mon Sep 17 00:00:00 2001 From: Guido Knips Date: Sun, 13 Aug 2023 18:50:44 +0200 Subject: [PATCH 07/23] Implement King in rust --- 53_King/rust/Cargo.lock | 16 ++ 53_King/rust/Cargo.toml | 9 + 53_King/rust/src/main.rs | 577 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 602 insertions(+) create mode 100644 53_King/rust/Cargo.lock create mode 100644 53_King/rust/Cargo.toml create mode 100644 53_King/rust/src/main.rs diff --git a/53_King/rust/Cargo.lock b/53_King/rust/Cargo.lock new file mode 100644 index 00000000..db44c2e7 --- /dev/null +++ b/53_King/rust/Cargo.lock @@ -0,0 +1,16 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "king" +version = "0.1.0" +dependencies = [ + "fastrand", +] diff --git a/53_King/rust/Cargo.toml b/53_King/rust/Cargo.toml new file mode 100644 index 00000000..c4f9c913 --- /dev/null +++ b/53_King/rust/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "king" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +fastrand = "^2.0.0" diff --git a/53_King/rust/src/main.rs b/53_King/rust/src/main.rs new file mode 100644 index 00000000..90b2aac6 --- /dev/null +++ b/53_King/rust/src/main.rs @@ -0,0 +1,577 @@ +#![forbid(unsafe_code)] + +use fastrand::Rng; +use std::io; +use std::io::{stdin, stdout, BufRead, Write}; + +// global variable `N5` in the original game +const TERM_LENGTH: u32 = 8; + +fn main() { + let mut rng = Rng::new(); + let mut input = stdin().lock(); + let mut state = intro(&mut input, &mut rng).expect("input error"); + + loop { + let land_price = 95 + rng.u32(0..10); + let plant_price = 10 + rng.u32(0..5); + print_state(&state, land_price, plant_price); + state = match next_round(&mut input, &mut rng, &state, land_price, plant_price) + .expect("input error") + { + RoundEnd::Next(s) => s, + RoundEnd::GameOver(msg) => { + println!("{}", msg); + return; + } + } + } +} + +// The game is round based (one round per in-game year). +// This struct represents the state before each round +#[derive(Clone, PartialEq, Eq, Debug)] +struct State { + // global variable `A` in the original game (currency: "rallods") + money: u32, + // global variable `B` in the original game + countrymen: u32, + // global variable `C` in the original game + foreign_workers: u32, + // global variable `D` in the original game + land: u32, + // global variable `X5` in original game + year_in_office: u32, + // global variable `X` in original game + show_land_hint: bool, + // global variable `V3` in original game + previous_tourist_trade: u32, +} + +#[derive(Clone, PartialEq, Eq, Debug)] +enum RoundEnd { + GameOver(String), + Next(State), +} + +fn init_state(rng: &mut Rng) -> State { + State { + // the original formula for random values used floating point numbers. + // e.g. `INT(60000+(1000*RND(1))-(1000*RND(1)))` + // I want to avoid floats unless necessary. These values generated here should be close + // enough to the original distribution + money: 60000 + rng.u32(0..1000) - rng.u32(0..1000), + countrymen: 500 + rng.u32(0..10) - rng.u32(0..10), + foreign_workers: 0, + land: 2000, + year_in_office: 0, + show_land_hint: true, + previous_tourist_trade: 0, + } +} + +fn print_state(state: &State, land_price: u32, plant_price: u32) { + print!( + r" +YOU NOW HAVE {} RALLODS IN THE TREASURY. + {} COUNTRYMEN, ", + state.money, state.countrymen + ); + if state.foreign_workers > 0 { + print!("{} FOREIGN WORKERS, ", state.foreign_workers) + } + println!( + r"AND {} SQ. MILES OF LAND. +THIS YEAR INDUSTRY WILL BUY LAND FOR {} RALLODS PER SQUARE MILE. +LAND CURRENTLY COSTS {} RALLODS PER SQUARE MILE TO PLANT. +", + state.land, land_price, plant_price + ); +} + +// print the intro, optional instructions or a previous savegame +fn intro(mut input: R, rng: &mut Rng) -> io::Result { + println!("⚠️ This game includes references to suicide or self-harm."); + println!(" KING"); + println!(" CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\n\n\n"); + print!("DO YOU WANT INSTRUCTIONS?? "); + // In the original game, all inputs were made in the same line as the previous output. + // I try to replicate this behaviour here, but if I do not print a line break, the stdout buffer + // will not be flushed and the user may not see the input prompt before the input. + // this means in these cases I have to explicitly flush stdout. + stdout().flush()?; + let mut buf = String::with_capacity(16); + input.read_line(&mut buf)?; + buf.make_ascii_lowercase(); + match buf.trim() { + "n" => Ok(init_state(rng)), + "again" => { + let year_in_office = read_and_verify_int( + &mut input, + &mut buf, + "HOW MANY YEARS HAD YOU BEEN IN OFFICE WHEN INTERRUPTED?? ", + |v| { + if v < 8 { + Ok(v) + } else { + Err(format!( + " COME ON, YOUR TERM IN OFFICE IS ONLY {} YEARS.", + TERM_LENGTH + )) + } + }, + )?; + // The original game exits here when you enter a negative number for any of + // the following values. This looks like intentional behaviour. However, to replicate that + // I would have to change everything to signed number which I do not want right now. + print!("HOW MUCH DID YOU HAVE IN THE TREASURY?? "); + stdout().flush()?; + let money = read_int(&mut input, &mut buf)?; + print!("HOW MANY COUNTRYMEN?? "); + stdout().flush()?; + let countrymen = read_int(&mut input, &mut buf)?; + print!("HOW MANY WORKERS?? "); + stdout().flush()?; + let foreign_workers = read_int(&mut input, &mut buf)?; + let land = read_and_verify_int( + &mut input, + &mut buf, + "HOW MANY SQUARE MILES OF LAND?? ", + |v| { + if !(1000..=2000).contains(&v) { + // Note: the original says "10,000 SQ. MILES OF FOREST LAND", but this is + // inconsistent and listed as Bug 3 in the README.md + Err(" COME ON, YOU STARTED WITH 1000 SQ. MILES OF FARM LAND\n AND 1000 SQ. MILES OF FOREST LAND.".to_owned()) + } else { + Ok(v) + } + }, + )?; + Ok(State { + money, + countrymen, + foreign_workers, + land, + year_in_office, + show_land_hint: true, + previous_tourist_trade: 0, + }) + } + _ => { + println!( + r" +CONGRATULATIONS! YOU'VE JUST BEEN ELECTED PREMIER OF SETATS +DETINU, A SMALL COMMUNIST ISLAND 30 BY 70 MILES LONG. YOUR +JOB IS TO DECIDE UPON THE CONTRY'S BUDGET AND DISTRIBUTE +MONEY TO YOUR COUNTRYMEN FROM THE COMMUNAL TREASURY. +THE MONEY SYSTEM IS RALLODS, AND EACH PERSON NEEDS 100 +RALLODS PER YEAR TO SURVIVE. YOUR COUNTRY'S INCOME COMES +FROM FARM PRODUCE AND TOURISTS VISITING YOUR MAGNIFICENT +FORESTS, HUNTING, FISHING, ETC. HALF YOUR LAND IS FARM LAND +WHICH ALSO HAS AN EXCELLENT MINERAL CONTENT AND MAY BE SOLD +TO FOREIGN INDUSTRY (STRIP MINING) WHO IMPORT AND SUPPORT +THEIR OWN WORKERS. CROPS COST BETWEEN 10 AND 15 RALLODS PER +SQUARE MILE TO PLANT. +YOUR GOAL IS TO COMPLETE YOUR {} YEAR TERM OF OFFICE. +GOOD LUCK! +", + TERM_LENGTH + ); + Ok(init_state(rng)) + } + } +} + +static POLLUTION: &[&str] = &[ + "FISH POPULATION HAS DWINDLED DUE TO WATER POLLUTION.", + "AIR POLLUTION IS KILLING GAME BIRD POPULATION.", + "MINERAL BATHS ARE BEING RUINED BY WATER POLLUTION.", + "UNPLEASANT SMOG IS DISCOURAGING SUN BATHERS.", + "HOTELS ARE LOOKING SHABBY DUE TO SMOG GRIT.", +]; + +fn next_round( + mut input: R, + rng: &mut Rng, + state: &State, + land_price: u32, + plant_price: u32, +) -> io::Result { + let mut buf = String::with_capacity(16); + let mut show_land_hint = state.show_land_hint; + // global variable `H` in the original game + let land_sold = read_and_verify_int( + &mut input, + &mut buf, + "HOW MANY SQUARE MILES DO YOU WISH TO SELL TO INDUSTRY?? ", + |v| { + if v + 1000 <= state.land { + Ok(v) + } else if show_land_hint { + show_land_hint = false; + Err(format!( + r"*** THINK AGAIN. YOU ONLY HAVE {} SQUARE MILES OF FARM LAND. +(FOREIGN INDUSTRY WILL ONLY BUY FARM LAND BECAUSE +FOREST LAND IS UNECONOMICAL TO STRIP MINE DUE TO TREES, +THICKER TOP SOIL, ETC.)", + state.land - 1000 + )) + } else { + Err(format!( + r"*** THINK AGAIN. YOU ONLY HAVE {} SQUARE MILES OF FARM LAND.\n", + state.land - 1000 + )) + } + }, + )?; + + let land = state.land - land_sold; + let money = state.money + land_sold * land_price; + + // global variable `I` in the original game + let money_distributed = read_and_verify_int( + &mut input, + &mut buf, + "HOW MANY RALLODS WILL YOU DISTRIBUTE AMONG YOUR COUNTRYMEN?? ", + |v| { + if v <= money { + Ok(v) + } else { + Err(format!( + " THINK AGAIN. YOU'VE ONLY {} RALLODS IN THE TREASURY", + money + )) + } + }, + )?; + let money = money - money_distributed; + + // global variable `J` in the original game + let land_planted = if money > 0 { + read_and_verify_int( + &mut input, + &mut buf, + "HOW MANY SQUARE MILES DO YOU WISH TO PLANT?? ", + |v| { + if v > 2 * state.countrymen { + Err(" SORRY, BUT EACH COUNTRYMAN CAN ONLY PLANT 2 SQ. MILES.".to_owned()) + } else if v + 1000 > land { + Err(format!( + " SORRY, BUT YOU'VE ONLY {} SQ. MILES OF FARM LAND.", + land - 1000 + )) + } else if v * plant_price > money { + Err(format!( + " THINK AGAIN. YOU'VE ONLY {} RALLODS LEFT IN THE TREASURY.", + money + )) + } else { + Ok(v) + } + }, + )? + } else { + 0 + }; + let money = money - land_planted * plant_price; + + // global variable `K` in the original game + let pollution_control = if money > 0 { + read_and_verify_int( + &mut input, + &mut buf, + "HOW MANY RALLODS DO YOU WISH TO SPEND ON POLLUTION CONTROL?? ", + |v| { + if v <= money { + Ok(v) + } else { + Err(format!( + " THINK AGAIN. YOU ONLY HAVE {} RALLODS REMAINING.", + money + )) + } + }, + )? + } else { + 0 + }; + let money = money - pollution_control; + + if land_sold == 0 && money_distributed == 0 && land_planted == 0 && pollution_control == 0 { + return Ok(RoundEnd::GameOver( + r" +GOODBYE. +(IF YOU WISH TO CONTINUE THIS GAME AT A LATER DATE, ANSWER +'AGAIN' WHEN ASKED IF YOU WANT INSTRUCTIONS AT THE START +OF THE GAME)." + .to_owned(), + )); + } + + println!("\n\n"); + + let money_after_expenses = money; + + let starvation_deaths = state.countrymen.saturating_sub(money_distributed / 100); + if starvation_deaths > 0 { + println!("{starvation_deaths} COUNTRYMEN DIED OF STARVATION"); + } + + // the original was using `RND(1)` as factor, but I do not want to deal with floats. + // this solution should do the same in the range of numbers we expect + let pollution = ((2000 - land) * rng.u32(0..=2000)) / 2000; + let pollution_deaths = if pollution_control >= 25 { + pollution / (pollution_control / 25) + } else { + pollution + }; + + if pollution_deaths > 0 { + println!( + "{} COUNTRYMEN DIED OF CARBON-MONOXIDE AND DUST INHALATION", + pollution_deaths + ); + } + + let (money, land) = if pollution_deaths + starvation_deaths > 0 { + let funeral_costs = (pollution_deaths + starvation_deaths) * 9; + println!(" YOU WERE FORCED TO SPEND {funeral_costs} RALLODS ON FUNERAL EXPENSES"); + if funeral_costs > money { + println!(" INSUFFICIENT RESERVES TO COVER COST - LAND WAS SOLD"); + ( + 0, + // I only handle integers here, but I think the basic code implicitly turns integers + // to floats on division. So in order to round up to the next full land unit, I have + // to do this weird modulo stuff here + land - funeral_costs / land_price + + if funeral_costs % land_price == 0 { + 0 + } else { + 1 + }, + ) + } else { + (money - funeral_costs, land) + } + } else { + (money, land) + }; + + let mut countrymen = state + .countrymen + .saturating_sub(starvation_deaths) + .saturating_sub(pollution_deaths); + + let tourist_trade_positive = countrymen * 22 + rng.u32(0..500); + let tourist_trade_negative = (2000 - land) * 15; + + let new_foreign_workers: i32 = if land_sold > 0 { + land_sold as i32 + rng.i32(0..10) - rng.i32(0..20) + + if state.foreign_workers == 0 { 20 } else { 0 } + } else { + 0 + }; + // In theory, we could come up with negative foreign workers here (and in the original game) + // This does not seem to be right, so let's cap them at 0 + let foreign_workers = if new_foreign_workers < 0 { + state + .foreign_workers + .saturating_sub(new_foreign_workers.unsigned_abs()) + } else { + state.foreign_workers + new_foreign_workers as u32 + }; + print!(" {new_foreign_workers} WORKERS CAME TO THE COUNTRY AND "); + + let countryman_migration = (money_distributed as i32 / 100 - countrymen as i32) / 10 + + pollution_control as i32 / 25 + - (2000 - land as i32) / 50 + - pollution_deaths as i32 / 2; + + if countryman_migration < 0 { + println!("{} COUNTRYMEN LEFT THE ISLAND", countryman_migration.abs()); + countrymen = countrymen.saturating_sub(countryman_migration.unsigned_abs()) + } else { + println!("{countryman_migration} COUNTRYMEN CAME TO THE ISLAND"); + countrymen += countryman_migration as u32 + } + + let harvest_lost = ((2000 - land) * (rng.u32(0..2000) + 3000)) / 4000; + // in the original game, this checked for foreign_workers == 0 instead of land_planted == 0 + // this is documented as Bug 4 in the README.md + if land_planted == 0 { + print!("OF {land_planted} SQ. MILES PLANTED,"); + } + println!( + " YOU HARVESTED {} SQ. MILES OF CROPS.", + land_planted.saturating_sub(harvest_lost) + ); + + if harvest_lost > 0 { + // There was a bug here in the original code (Bug 2 in README.md). + // Based on the variable `V1`, the word `INCREASED` was inserted. + // However, no value was ever assigned to `V1`. Since the pollution comes from land that has + // been sold, I used the land difference to check whether the pollution increased. + if state.land < land { + println!(" (DUE TO INCREASED AIR AND WATER POLLUTION FROM FOREIGN INDUSTRY.)"); + } else { + println!(" (DUE TO AIR AND WATER POLLUTION FROM FOREIGN INDUSTRY.)"); + } + } + + let crop_winnings = land_planted.saturating_sub(harvest_lost) * land_price / 2; + println!("MAKING {crop_winnings} RALLODS."); + let money = money + crop_winnings; + + // In the original game, there are two bugs here (documented as Bug 1 and Bug 5 in the README.md) + // The first one made the game ignore the income from tourists and duplicated the money that was + // left at this point (the "DECREASE BECAUSE"-message would never have been shown). + // The second bug made the tourist trade profitable again is the pollution was too high (i.e. + // if `tourist_trade_positive` was less than `tourist_trade_negative` + let tourist_trade = tourist_trade_positive.saturating_sub(tourist_trade_negative); + println!(" YOU MADE {tourist_trade} RALLODS FROM TOURIST TRADE."); + if tourist_trade < state.previous_tourist_trade { + println!( + " DECREASE BECAUSE {}", + POLLUTION[rng.usize(0..POLLUTION.len())] + ); + } + let money = money + tourist_trade; + + if starvation_deaths + pollution_deaths > 200 { + let reason = rng.u8(0..10); + return Ok(RoundEnd::GameOver(format!( + r" + + {} COUNTRYMEN DIED IN ONE YEAR!!!!! +DUE TO THIS EXTREME MISMANAGEMENT, YOU HAVE NOT ONLY +BEEN IMPEACHED AND THROWN OUT OF OFFICE, BUT YOU +{} +", + starvation_deaths + pollution_deaths, + // The reasons are not equally probable in the original game. + // I wonder if this was intentional. + if reason <= 3 { + "ALSO HAD YOUR LEFT EYE GOUGED OUT!" + } else if reason <= 6 { + "HAVE ALSO GAINED A VERY BAD REPUTATION." + } else { + "HAVE ALSO BEEN DECLARED NATIONAL FINK." + } + ))); + } + if countrymen < 343 { + // This is not entirely fair, it is possible that some of them just left, not died. + // Also: the initial number of countrymen varies a bit, but this boundary is fix, so it is + // not always a third + return Ok(RoundEnd::GameOver(format!( + r" + +OVER ONE THIRD OF THE POPULTATION HAS DIED SINCE YOU +WERE ELECTED TO OFFICE. THE PEOPLE (REMAINING) +HATE YOUR GUTS. +{} +", + departure_flavour(rng) + ))); + } + if money_after_expenses / 100 > 5 && starvation_deaths >= 2 { + return Ok(RoundEnd::GameOver( + r" +MONEY WAS LEFT OVER IN THE TREASURY WHICH YOU DID +NOT SPEND. AS A RESULT, SOME OF YOUR COUNTRYMEN DIED +OF STARVATION. THE PUBLIC IS ENRAGED AND YOU HAVE +BEEN FORCED TO EITHER RESIGN OR COMMIT SUICIDE. +THE CHOICE IS YOURS. +IF YOU CHOOSE THE LATTER, PLEASE TURN OFF YOUR COMPUTER +BEFORE PROCEEDING. +" + .to_owned(), + )); + } + if foreign_workers > countrymen { + return Ok(RoundEnd::GameOver(format!( + r" + +THE NUMBER OF FOREIGN WORKERS HAS EXCEEDED THE NUMBER +OF COUNTRYMEN. AS A MINORITY, THEY HAVE REVOLTED AND +TAKEN OVER THE COUNTRY. +{} +", + departure_flavour(rng) + ))); + } + if state.year_in_office + 1 >= TERM_LENGTH { + return Ok(RoundEnd::GameOver(format!( + r" + +CONGRATULATIONS!!!!!!!!!!!!!!!!!! +YOU HAVE SUCCESFULLY COMPLETED YOUR {} YEAR TERM +OF OFFICE. YOU WERE, OF COURSE, EXTREMELY LUCKY, BUT +NEVERTHELESS, IT'S QUITE AN ACHIEVEMENT. GOODBYE AND GOOD +LUCK - YOU'LL PROBABLY NEED IT IF YOU'RE THE TYPE THAT +PLAYS THIS GAME. +", + TERM_LENGTH + ))); + } + + Ok(RoundEnd::Next(State { + money, + countrymen, + foreign_workers, + land, + year_in_office: state.year_in_office + 1, + show_land_hint, + previous_tourist_trade: tourist_trade, + })) +} + +fn departure_flavour(rng: &mut Rng) -> &'static str { + if rng.bool() { + "YOU HAVE BEEN THROWN OUT OF OFFICE AND ARE NOW\nRESIDING IN PRISON.\n" + } else { + "YOU HAVE BEEN ASSASSINATED.\n" + } +} + +fn read_int(mut input: R, buf: &mut String) -> io::Result { + loop { + buf.clear(); + input.read_line(buf)?; + let line = buf.trim(); + // This is implicit behaviour in the original code: empty input is equal to 0 + if line.is_empty() { + return Ok(0); + } + if let Ok(n) = line.parse::() { + return Ok(n); + } else { + print!("??REENTER\n?? "); + stdout().flush()?; + } + } +} + +fn read_and_verify_int( + mut input: R, + buf: &mut String, + prompt: &str, + mut verify: Verify, +) -> io::Result +where + Verify: FnMut(u32) -> Result, +{ + loop { + print!("{}", prompt); + stdout().flush()?; + let v = read_int(&mut input, buf)?; + match verify(v) { + Ok(v) => { + return Ok(v); + } + Err(msg) => { + println!("{}", msg); + } + } + } +} From 3742b8fede129171d6e1bad1fe0db1afca2189d3 Mon Sep 17 00:00:00 2001 From: Guido Knips Date: Tue, 29 Aug 2023 21:00:15 +0200 Subject: [PATCH 08/23] Add README.md for rust King --- 53_King/rust/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 53_King/rust/README.md diff --git a/53_King/rust/README.md b/53_King/rust/README.md new file mode 100644 index 00000000..529da33b --- /dev/null +++ b/53_King/rust/README.md @@ -0,0 +1,28 @@ +King +==== + +Original source downloaded [from Vintage Basic](http://www.vintage-basic.net/games.html) + +Conversion to [rust](https://www.rust-lang.org/). + +Porting Notes +------------- + +### Floats + +The original code implicitly uses floating point numbers in many places which are explicitly cast to integers. In this port, I avoided using floats and tried to replicate the behaviour using just integers. It is possible that I missed some places where rounding a value would have made a difference. If you find such a bug, please notify me or make implement a fix yourself. + +### Signed Numbers + +I used unsigned integers for most of the program because it was easier than to check for negative values all the time. Unfortunately, that made the code a bit whacky in one or two places. + +Since I only allow input of positive numbers, it is not possible to exit the game when entering the stats to resume a game, which would be possible by entering negative numbers in the original game. + +### Bugs + +I tried to fix all bugs listed in the [main README for King](../README.md). I have tested this implementation a bit but not extensively, so there may be some portation bugs. If you find them, you are free to fix them. + +Future Development +------------------ + +I plan to add some tests and tidy up the code a bit, but this version should be feature-complete. From 0e8619802d15ef6c2f53d008895416cdc2eebffb Mon Sep 17 00:00:00 2001 From: Guido Knips Date: Tue, 29 Aug 2023 21:11:38 +0200 Subject: [PATCH 09/23] Add rust version of King to progress table --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4532cf8..0544ea2e 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ NOTE: per [the official blog post announcement](https://blog.codinghorror.com/up | 50_Horserace | x | | x | | | | | | x | x | | 51_Hurkle | x | x | x | | | x | x | x | x | x | | 52_Kinema | x | x | x | | | x | x | x | | x | -| 53_King | x | | x | | | | x | | | x | +| 53_King | x | | x | | | | x | | x | x | | 54_Letter | x | x | x | | | x | x | x | x | x | | 55_Life | x | x | x | | | x | x | x | x | x | | 56_Life_for_Two | x | x | x | | | x | x | | | x | From a358e441cee622f018d852c6055cedead39d52b9 Mon Sep 17 00:00:00 2001 From: Guido Knips Date: Wed, 30 Aug 2023 21:51:03 +0200 Subject: [PATCH 10/23] Add rust implementation for 23 Matches --- 93_23_Matches/README.md | 2 +- 93_23_Matches/rust/Cargo.lock | 16 +++++ 93_23_Matches/rust/Cargo.toml | 9 +++ 93_23_Matches/rust/README.md | 3 + 93_23_Matches/rust/src/main.rs | 108 +++++++++++++++++++++++++++++++++ 5 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 93_23_Matches/rust/Cargo.lock create mode 100644 93_23_Matches/rust/Cargo.toml create mode 100644 93_23_Matches/rust/README.md create mode 100644 93_23_Matches/rust/src/main.rs diff --git a/93_23_Matches/README.md b/93_23_Matches/README.md index 8ef8d6f8..e4ece5fd 100644 --- a/93_23_Matches/README.md +++ b/93_23_Matches/README.md @@ -19,4 +19,4 @@ http://www.vintage-basic.net/games.html #### Porting Notes -(please note any difficulties or challenges in porting here) +There is an oddity (you can call it a bug, but it is no big deal) in the original code. If there are only two or three matches left at the player's turn and the player picks all of them (or more), the game would still register that as a win for the player. diff --git a/93_23_Matches/rust/Cargo.lock b/93_23_Matches/rust/Cargo.lock new file mode 100644 index 00000000..96e2f79e --- /dev/null +++ b/93_23_Matches/rust/Cargo.lock @@ -0,0 +1,16 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "twenty-three-matches" +version = "0.1.0" +dependencies = [ + "fastrand", +] diff --git a/93_23_Matches/rust/Cargo.toml b/93_23_Matches/rust/Cargo.toml new file mode 100644 index 00000000..a4227bbd --- /dev/null +++ b/93_23_Matches/rust/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "twenty-three-matches" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +fastrand = "^2.0.0" diff --git a/93_23_Matches/rust/README.md b/93_23_Matches/rust/README.md new file mode 100644 index 00000000..6249450a --- /dev/null +++ b/93_23_Matches/rust/README.md @@ -0,0 +1,3 @@ +Original source downloaded [from Vintage Basic](http://www.vintage-basic.net/games.html) + +Conversion to [rust](https://www.rust-lang.org/) diff --git a/93_23_Matches/rust/src/main.rs b/93_23_Matches/rust/src/main.rs new file mode 100644 index 00000000..a14c39f5 --- /dev/null +++ b/93_23_Matches/rust/src/main.rs @@ -0,0 +1,108 @@ +use std::io; +use std::io::{stdin, stdout, BufRead, Write}; + +fn main() -> io::Result<()> { + intro(); + let mut input = stdin().lock(); + let mut buf = String::with_capacity(16); + // variable `N` in the original game + let mut matches: u8 = 23; + if fastrand::bool() { + println!("TAILS! YOU GO FIRST. \n"); + } else { + println!("HEADS! I WIN! HA! HA!\nPREPARE TO LOSE, MEATBALL-NOSE!!\n\nI TAKE 2 MATCHES"); + matches -= 2; + println!("THE NUMBER OF MATCHES IS NOW {matches}\n"); + println!("YOUR TURN -- YOU MAY TAKE 1, 2 OR 3 MATCHES."); + } + loop { + // variable `K` in the original game + let human_picked = read_matches(&mut input, &mut buf)?; + matches = matches.saturating_sub(human_picked); + if matches == 0 { + // this can only happen if the player could win with the next turn but they take too + // many matches (e.g. if there are three matches left and the player takes three instead of + // two). In the original game, this would count as a win for the player. + println!("\nYOU POOR BOOB! YOU TOOK THE LAST MATCH! I GOTCHA!!\nHA ! HA ! I BEAT YOU !!!\n\nGOOD BYE LOSER!"); + return Ok(()); + } + + println!("THERE ARE NOW {matches} MATCHES REMAINING."); + + if matches <= 1 { + println!("YOU WON, FLOPPY EARS !\nTHINK YOU'RE PRETTY SMART !\nLETS PLAY AGAIN AND I'LL BLOW YOUR SHOES OFF !!"); + return Ok(()); + } + + // variable `Z` in the original game + let ai_picked = ai_pick(matches, human_picked); + println!("MY TURN ! I REMOVE {ai_picked} MATCHES"); + matches = matches.saturating_sub(ai_picked); + // The AI will never pick the last match except for the case where only one match is left (which is handled above) + if matches == 1 { + println!("\nYOU POOR BOOB! YOU TOOK THE LAST MATCH! I GOTCHA!!\nHA ! HA ! I BEAT YOU !!!\n\nGOOD BYE LOSER!"); + return Ok(()); + } + println!("THE NUMBER OF MATCHES IS NOW {matches}\n"); + println!("YOUR TURN -- YOU MAY TAKE 1, 2 OR 3 MATCHES."); + } +} + +fn intro() { + println!( + r" 23 MATCHES + CREATIVE COMPUTING MORRISTOWN, NEW JERSEY + + + + THIS IS A GAME CALLED '23 MATCHES'. + +WHEN IT IS YOUR TURN, YOU MAY TAKE ONE, TWO, OR THREE +MATCHES. THE OBJECT OF THE GAME IS NOT TO HAVE TO TAKE +THE LAST MATCH. + +LET'S FLIP A COIN TO SEE WHO GOES FIRST. +IF IT COMES UP HEADS, I WILL WIN THE TOSS. +" + ); +} + +fn read_matches(mut input: R, buf: &mut String) -> io::Result { + print!("HOW MANY DO YOU WISH TO REMOVE ?? "); + stdout().flush()?; + loop { + let input = read_int(&mut input, buf)?; + if input <= 0 || input > 3 { + print!("VERY FUNNY! DUMMY!\nDO YOU WANT TO PLAY OR GOOF AROUND?\nNOW, HOW MANY MATCHES DO YOU WANT ?? "); + stdout().flush()?; + } else { + return Ok(input as u8); + } + } +} + +fn read_int(mut input: R, buf: &mut String) -> io::Result { + loop { + buf.clear(); + input.read_line(buf)?; + let line = buf.trim(); + // This is implicit behaviour in the original code: empty input is equal to 0 + if line.is_empty() { + return Ok(0); + } + if let Ok(n) = line.parse::() { + return Ok(n); + } else { + print!("??REENTER\n?? "); + stdout().flush()?; + } + } +} + +fn ai_pick(matches: u8, human_picked: u8) -> u8 { + if matches < 4 { + matches - 1 + } else { + 4 - human_picked + } +} From b11b45e7906637c94d4c45c75712bc021ecf0781 Mon Sep 17 00:00:00 2001 From: Guido Knips Date: Wed, 30 Aug 2023 22:09:30 +0200 Subject: [PATCH 11/23] List 23 Matches as implemented for rust --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0544ea2e..0ddd2748 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ NOTE: per [the official blog post announcement](https://blog.codinghorror.com/up | 90_Tower | x | x | x | | | x | x | | x | x | | 91_Train | x | x | x | | | x | x | x | x | x | | 92_Trap | x | x | x | | | x | x | x | x | x | -| 93_23_Matches | x | x | x | | | x | x | x | | x | +| 93_23_Matches | x | x | x | | | x | x | x | x | x | | 94_War | x | x | x | x | | x | x | x | x | x | | 95_Weekday | x | x | x | | | x | x | | x | x | | 96_Word | x | x | x | | | x | x | x | x | x | From 7dff2a67e797db298c36cef128fdee555efae202 Mon Sep 17 00:00:00 2001 From: lmstolton Date: Mon, 4 Sep 2023 19:29:18 +0100 Subject: [PATCH 12/23] Changed get_input() to return Option --- 43_Hammurabi/rust/src/main.rs | 64 ++++++++++++++++------------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/43_Hammurabi/rust/src/main.rs b/43_Hammurabi/rust/src/main.rs index 061d502e..529a6145 100644 --- a/43_Hammurabi/rust/src/main.rs +++ b/43_Hammurabi/rust/src/main.rs @@ -46,28 +46,27 @@ fn run() { loop { println!("HOW MANY ACRES DO YOU WISH TO BUY? "); if let Some(qty) = get_input() { - if qty < 0 { // A negative amount is impossible - impossible_task(); - game_failed = true; - break 'main; - } // Player decides not to buy any land if qty == 0 { bought_land = false; break; } // Trying to buy more land than you can afford? - if land_price * qty as u32 > grain { + if land_price * qty > grain { insufficient_grain(grain); continue; } // Everything checks out OK - if land_price * qty as u32 <= grain { - acres += qty as u32; - grain -= land_price * qty as u32; + if land_price * qty <= grain { + acres += qty ; + grain -= land_price * qty ; bought_land = true; break; } + } else { + impossible_task(); + game_failed = true; + break 'main; } } @@ -75,19 +74,18 @@ fn run() { loop { println!("HOW MANY ACRES DO YOU WISH TO SELL? "); if let Some(qty) = get_input() { - if qty < 0 { // A negative amount is impossible - impossible_task(); - game_failed = true; - break 'main; - } // Everything checks out OK - if qty as u32 <= acres { - acres -= qty as u32; - grain += land_price * qty as u32; + if qty <= acres { + acres -= qty; + grain += land_price * qty; break; } // Trying to sell more land that you own insufficient_land(acres); + } else { + impossible_task(); + game_failed = true; + break 'main; } } } @@ -95,50 +93,48 @@ fn run() { loop { println!("HOW MANY BUSHELS DO YOU WISH TO FEED YOUR PEOPLE? "); if let Some(qty) = get_input() { - if qty < 0 { // A negative amount is impossible - impossible_task(); - game_failed = true; - break 'main; - } // Trying to use more grain than is in silos? - if qty as u32 > grain { + if qty > grain { insufficient_grain(grain); continue; } // Everything checks out OK - bushels_fed = qty as u32; + bushels_fed = qty; grain -= bushels_fed; break; + } else { + impossible_task(); + game_failed = true; + break 'main; } } loop { println!("HOW MANY ACRES DO YOU WISH TO PLANT WITH SEED? "); if let Some(qty) = get_input() { - if qty < 0 { // A negative amount is impossible - impossible_task(); - game_failed = true; - break 'main; - } // Trying to plant more acres than you own? - if qty as u32 > acres { + if qty > acres { insufficient_land(acres); continue; } // Enough grain for seed? - if qty as u32 / 2 > grain { + if qty / 2 > grain { insufficient_grain(grain); continue; } // Enough people to tend the crops? - if qty as u32 > (10 * population) { + if qty > (10 * population) { insufficient_people(population); continue; } // Everything checks out OK - planted = qty as u32; + planted = qty; grain -= planted / 2; break; + } else { + impossible_task(); + game_failed = true; + break 'main; } } @@ -217,7 +213,7 @@ fn run() { println!("\nSO LONG FOR NOW.\n"); } -fn get_input() -> Option { +fn get_input() -> Option { let mut input = String::new(); io::stdin().read_line(&mut input).expect("Failed read_line"); match input.trim().parse() { From 4ae8c5502f48300eebe251b0e0e74c7102954cfd Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Thu, 24 Aug 2023 14:31:34 -0700 Subject: [PATCH 13/23] Added MiniScript versions of 50_Horserace and 51_Hurkle. --- .../50_Horserace/MiniScript/README.md | 23 +++ .../50_Horserace/MiniScript/horserace.ms | 149 ++++++++++++++++++ .../51_Hurkle/MiniScript/README.md | 19 +++ .../51_Hurkle/MiniScript/hurkle.ms | 56 +++++++ 4 files changed, 247 insertions(+) create mode 100644 00_Alternate_Languages/50_Horserace/MiniScript/README.md create mode 100644 00_Alternate_Languages/50_Horserace/MiniScript/horserace.ms create mode 100644 00_Alternate_Languages/51_Hurkle/MiniScript/README.md create mode 100644 00_Alternate_Languages/51_Hurkle/MiniScript/hurkle.ms diff --git a/00_Alternate_Languages/50_Horserace/MiniScript/README.md b/00_Alternate_Languages/50_Horserace/MiniScript/README.md new file mode 100644 index 00000000..c9a5cd1f --- /dev/null +++ b/00_Alternate_Languages/50_Horserace/MiniScript/README.md @@ -0,0 +1,23 @@ +Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). + +Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +1. Command-Line MiniScript: +Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: + + miniscript horserace.ms + +2. Mini Micro: +Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: + + load "horserace" + run + + +## Porting Notes + +- The original program, designed to be played directly on a printer, drew a track 27 rows long. To fit better on modern screens, I've shortened the track to 23 rows. This is adjustable via the "trackLen" value assigned on line 72. + +- Also because we're playing on a screen instead of a printer, I'm clearing the screen and pausing briefly before each new update of the track. This is done via the `clear` API when running in Mini Micro, or by using a VT100 escape sequence in other contexts. diff --git a/00_Alternate_Languages/50_Horserace/MiniScript/horserace.ms b/00_Alternate_Languages/50_Horserace/MiniScript/horserace.ms new file mode 100644 index 00000000..a8750f5e --- /dev/null +++ b/00_Alternate_Languages/50_Horserace/MiniScript/horserace.ms @@ -0,0 +1,149 @@ +print " "*31 + "Horserace" +print " "*15 + "Creative Computing Morristown, New Jersey" +print; print; print + +print "Welcome to South Portland High Racetrack" +print " ...owned by Laurie Chevalier" + +// show directions, if wanted +x = input("Do you want directions? ").lower +if not x or x[0] != "n" then + print "Up to 10 may play. A table of odds will be printed. You" + print "may bet any + amount under 100000 on one horse." + print "During the race, a horse will be shown by its" + print "number. The horses race down the paper!" + print +end if + +// get player names +qtyPlayers = input("How many want to bet? ").val +if qtyPlayers < 1 then exit +print "When ? appears, type name" +playerNames = [null] +for i in range(1, qtyPlayers) + playerNames.push input("?") +end for +print +pick = [null] + [0]*qtyPlayers +bet = [null] + [0]*qtyPlayers + +d = [0] * 9 // odds denominator +r = 0 // odds numerator + +printInColumns = function(col0, col1, col2) + print (col0+" "*16)[16] + (col1+" "*10)[:10] + (col2+" "*10)[:10] +end function + +setup = function + // initialize the horses + globals.names = [null] + + "Joe Maw,L.B.J.,Mr.Washburn,Miss Karen,Jolly,Horse,Jelly Do Not,Midnight".split(",") + for i in range(1,8) + d[i] = floor(10*rnd+1) + end for + globals.r = d.sum + + // print odds table + printInColumns "Horse", "Number", "Odds" + for i in range(1,8) + printInColumns names[i], i, round(r/d[i],2) + ":1" + end for + + // get the players' bets + print "--------------------------------------------------" + print "Place your bets...Horse # then Amount" + for j in range(1, qtyPlayers) + while true + s = input(playerNames[j] + "? ").replace(",", " ").split + if s.len < 2 then s.push -1 + pick[j] = s[0].val + bet[j] = s[-1].val + if pick[j] < 1 or pick[j] > 8 or bet[j] < 1 or bet[j] >=100000 then + print "You can't do that!" + else + break + end if + end while + end for +end function + +// Draw a racetrack, with each horse the given number +// of lines down from START to FINISH. +trackLen = 23 +drawTrack = function(horsePositions) + print + if version.hostName == "Mini Micro" then clear else print char(27)+"c" + if horsePositions[1] == 0 then print "1 2 3 4 5 6 7 8" else print + print "XXXXSTARTXXXX" + for row in range(1, trackLen) + for h in range(1,8) + p = horsePositions[h] + if p > trackLen then p = trackLen + if p == row then print h, " " + end for + print + end for + print "XXXXFINISHXXXX", "" + if version.hostName != "Mini Micro" then print +end function + +runRace = function + pos = [0]*9 + maxPos = 0 + while true + drawTrack pos + wait 1 + if maxPos >= trackLen then break + for i in range(1,8) + q = floor(100*rnd+1) + x = floor(r/d[i]+0.5) + if q < 10 then + speed = 1 + else if q < x+17 then + speed = 2 + else if q < x+37 then + speed = 3 + else if q < x+57 then + speed = 4 + else if q < x+77 then + speed = 5 + else if q < x+92 then + speed = 6 + else + speed = 7 + end if + pos[i] += speed + if pos[i] > maxPos then maxPos = pos[i] + end for + end while + + print + print "---------------------------------------------" + print + print "The race results are:" + results = [] + for i in range(1,8) + results.push {"num":i, "pos":pos[i]} + end for + results.sort "pos", false + for place in range(1, 8) + h = results[place-1].num + print " " + place + " Place Horse No. " + h + " at " + round(r/d[h],2) + ":1" + print + end for + for p in range(1, qtyPlayers) + if pick[p] == results[0].num then + print playerNames[p] + " wins $" + round((r/d[pick[p]])*bet[p], 2) + end if + end for +end function + +// Main loop +while true + setup + runRace + print "Do you want to bet on the next race ?" + yn = input("Yes or no? ").lower + if not yn or yn[0] != "y" then break +end while + diff --git a/00_Alternate_Languages/51_Hurkle/MiniScript/README.md b/00_Alternate_Languages/51_Hurkle/MiniScript/README.md new file mode 100644 index 00000000..0f4ff6a6 --- /dev/null +++ b/00_Alternate_Languages/51_Hurkle/MiniScript/README.md @@ -0,0 +1,19 @@ +Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). + +Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +0. Try-It! Page: +Go to https://miniscript.org/tryit/, clear the sample code from the code editor, and paste in the contents of hurkle.ms. Then click the "Run Script" button. Program output (and input) will appear in the green-on-black terminal display to the right of or below the code editor. + +1. Command-Line MiniScript: +Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: + + miniscript hurkle.ms + +2. Mini Micro: +Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: + + load "hurkle" + run diff --git a/00_Alternate_Languages/51_Hurkle/MiniScript/hurkle.ms b/00_Alternate_Languages/51_Hurkle/MiniScript/hurkle.ms new file mode 100644 index 00000000..a1b22822 --- /dev/null +++ b/00_Alternate_Languages/51_Hurkle/MiniScript/hurkle.ms @@ -0,0 +1,56 @@ +print " "*33 + "Hurcle" +print " "*15 + "Creative Computing Morristown, New Jersey" +print; print; print +n = 5 // number of guesses allowed +g = 10 // grid size +print +print "A hurkle is hiding on a " + g + " by " + g + " grid. Homebase" +print "on the grid is point 0,0 in the southwest corner," +print "and any point on the grid is designated by a" +print "pair of whole numbers seperated by a comma. The first" +print "number is the horizontal position and the second number" +print "is the vertical position. You must try to" +print "guess the hurkle's gridpoint. You get " + n + "tries." +print "After each try, I will tell you the approximate" +print "direction to go to look for the hurkle." +print + +playOneGame = function + a = floor(g*rnd) + b = floor(g*rnd) + for k in range(1, n) + s = input("Guess #" + k + "? ").replace(",", " ").split + x = s[0].val + y = s[-1].val + if x == a and y == b then + print + print "You found him in " + k + " guesses!" + return + end if + if y == b then + if x == a then + print + print "You found him in " + k + " guesses!" + return + else if x < a then + dir = "east" + else + dir = "west" + end if + else if y < b then + dir = "north" + else + dir = "south" + end if + print "Go " + dir + end for + print "Sorry, that's " + n + " guesses." + print "The hurkle is at " + a + "," + b +end function + +while true + playOneGame + print + print "Let's play again, hurkle is hiding." + print +end while From 06caa5085beeb56d04f0cd721953c40c54698249 Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Fri, 25 Aug 2023 10:29:48 -0700 Subject: [PATCH 14/23] Added code markup around MiniScript commands in the README files, for clarity --- .../01_Acey_Ducey/MiniScript/README.md | 5 ++++- .../02_Amazing/MiniScript/README.md | 5 ++++- .../03_Animal/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/04_Awari/MiniScript/README.md | 5 ++++- .../05_Bagels/MiniScript/README.md | 5 ++++- .../06_Banner/MiniScript/README.md | 5 ++++- .../07_Basketball/MiniScript/README.md | 5 ++++- .../08_Batnum/MiniScript/README.md | 5 ++++- .../09_Battle/MiniScript/README.md | 5 ++++- .../10_Blackjack/MiniScript/README.md | 5 ++++- .../11_Bombardment/MiniScript/README.md | 5 ++++- .../12_Bombs_Away/MiniScript/README.md | 5 ++++- .../13_Bounce/MiniScript/README.md | 5 ++++- .../14_Bowling/MiniScript/README.md | 5 ++++- .../15_Boxing/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/16_Bug/MiniScript/README.md | 5 ++++- .../17_Bullfight/MiniScript/README.md | 5 ++++- .../18_Bullseye/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/19_Bunny/MiniScript/README.md | 5 ++++- .../20_Buzzword/MiniScript/README.md | 5 ++++- .../21_Calendar/MiniScript/README.md | 5 ++++- .../22_Change/MiniScript/README.md | 5 ++++- .../23_Checkers/MiniScript/README.md | 5 ++++- .../24_Chemist/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/25_Chief/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/26_Chomp/MiniScript/README.md | 5 ++++- .../27_Civil_War/MiniScript/README.md | 5 ++++- .../28_Combat/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/29_Craps/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/30_Cube/MiniScript/README.md | 5 ++++- .../31_Depth_Charge/MiniScript/README.md | 5 ++++- .../32_Diamond/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/33_Dice/MiniScript/README.md | 6 ++++-- .../34_Digits/MiniScript/README.md | 5 ++++- .../35_Even_Wins/MiniScript/README.md | 11 ++++++++--- .../36_Flip_Flop/MiniScript/README.md | 5 ++++- .../37_Football/MiniScript/README.md | 12 ++++++++---- .../38_Fur_Trader/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/39_Golf/MiniScript/README.md | 5 ++++- .../40_Gomoko/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/41_Guess/MiniScript/README.md | 6 ++++-- .../42_Gunner/MiniScript/README.md | 5 ++++- .../43_Hammurabi/MiniScript/README.md | 5 ++++- .../44_Hangman/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/45_Hello/MiniScript/README.md | 5 ++++- .../46_Hexapawn/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/47_Hi-Lo/MiniScript/README.md | 5 ++++- .../48_High_IQ/MiniScript/README.md | 5 ++++- .../49_Hockey/MiniScript/README.md | 5 ++++- .../50_Horserace/MiniScript/README.md | 6 ++++-- .../51_Hurkle/MiniScript/README.md | 5 ++++- .../52_Kinema/MiniScript/README.md | 6 ++++-- .../54_Letter/MiniScript/README.md | 6 ++++-- .../64_Nicomachus/MiniScript/README.md | 6 ++++-- .../66_Number/MiniScript/README.md | 6 ++++-- .../78_Sine_Wave/MiniScript/README.md | 5 ++++- .../87_3-D_Plot/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/91_Train/MiniScript/README.md | 6 ++++-- 00_Alternate_Languages/92_Trap/MiniScript/README.md | 5 ++++- 00_Alternate_Languages/94_War/MiniScript/README.md | 5 ++++- 60 files changed, 248 insertions(+), 73 deletions(-) diff --git a/00_Alternate_Languages/01_Acey_Ducey/MiniScript/README.md b/00_Alternate_Languages/01_Acey_Ducey/MiniScript/README.md index c14b6da8..06640e03 100644 --- a/00_Alternate_Languages/01_Acey_Ducey/MiniScript/README.md +++ b/00_Alternate_Languages/01_Acey_Ducey/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript aceyducey.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "aceyducey" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/02_Amazing/MiniScript/README.md b/00_Alternate_Languages/02_Amazing/MiniScript/README.md index 301324c6..35d818ef 100644 --- a/00_Alternate_Languages/02_Amazing/MiniScript/README.md +++ b/00_Alternate_Languages/02_Amazing/MiniScript/README.md @@ -7,12 +7,15 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript amazing.ms - +``` Note that because this program imports "listUtil", you will need to have a the standard MiniScript libraries somewhere in your import path. 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "amazing" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/03_Animal/MiniScript/README.md b/00_Alternate_Languages/03_Animal/MiniScript/README.md index 580dd0de..1e48ea49 100644 --- a/00_Alternate_Languages/03_Animal/MiniScript/README.md +++ b/00_Alternate_Languages/03_Animal/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript animal.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "animal" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/04_Awari/MiniScript/README.md b/00_Alternate_Languages/04_Awari/MiniScript/README.md index 74454112..f2b6dfe5 100644 --- a/00_Alternate_Languages/04_Awari/MiniScript/README.md +++ b/00_Alternate_Languages/04_Awari/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript awari.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "awari" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/05_Bagels/MiniScript/README.md b/00_Alternate_Languages/05_Bagels/MiniScript/README.md index 42748246..743d5160 100644 --- a/00_Alternate_Languages/05_Bagels/MiniScript/README.md +++ b/00_Alternate_Languages/05_Bagels/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript bagels.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "bagels" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/06_Banner/MiniScript/README.md b/00_Alternate_Languages/06_Banner/MiniScript/README.md index f9363853..25a241af 100644 --- a/00_Alternate_Languages/06_Banner/MiniScript/README.md +++ b/00_Alternate_Languages/06_Banner/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript banner.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "banner" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/07_Basketball/MiniScript/README.md b/00_Alternate_Languages/07_Basketball/MiniScript/README.md index 019fccb8..5958590e 100644 --- a/00_Alternate_Languages/07_Basketball/MiniScript/README.md +++ b/00_Alternate_Languages/07_Basketball/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript basketball.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "basketball" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/08_Batnum/MiniScript/README.md b/00_Alternate_Languages/08_Batnum/MiniScript/README.md index bec1c7e0..b33a3f84 100644 --- a/00_Alternate_Languages/08_Batnum/MiniScript/README.md +++ b/00_Alternate_Languages/08_Batnum/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript batnum.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "batnum" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/09_Battle/MiniScript/README.md b/00_Alternate_Languages/09_Battle/MiniScript/README.md index 0e807f51..07cd9827 100644 --- a/00_Alternate_Languages/09_Battle/MiniScript/README.md +++ b/00_Alternate_Languages/09_Battle/MiniScript/README.md @@ -9,10 +9,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript battle.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "battle" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/10_Blackjack/MiniScript/README.md b/00_Alternate_Languages/10_Blackjack/MiniScript/README.md index 49c8818a..2f68bb79 100644 --- a/00_Alternate_Languages/10_Blackjack/MiniScript/README.md +++ b/00_Alternate_Languages/10_Blackjack/MiniScript/README.md @@ -7,12 +7,15 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript blackjack.ms - +``` But note that the current release (1.2.1) of command-line MiniScript does not properly flush the output buffer when line breaks are suppressed, as this program does when prompting for your next action after a Hit. So, method 2 (below) is recommended for now. 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "blackjack" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/11_Bombardment/MiniScript/README.md b/00_Alternate_Languages/11_Bombardment/MiniScript/README.md index d6e7e393..4a399a7b 100644 --- a/00_Alternate_Languages/11_Bombardment/MiniScript/README.md +++ b/00_Alternate_Languages/11_Bombardment/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript bombardment.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "bombardment" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/12_Bombs_Away/MiniScript/README.md b/00_Alternate_Languages/12_Bombs_Away/MiniScript/README.md index e7cb424c..22bcc0b1 100644 --- a/00_Alternate_Languages/12_Bombs_Away/MiniScript/README.md +++ b/00_Alternate_Languages/12_Bombs_Away/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript bombsaway.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "bombsaway" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/13_Bounce/MiniScript/README.md b/00_Alternate_Languages/13_Bounce/MiniScript/README.md index d129ed9b..e7e8f23a 100644 --- a/00_Alternate_Languages/13_Bounce/MiniScript/README.md +++ b/00_Alternate_Languages/13_Bounce/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript bounce.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "bounce" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/14_Bowling/MiniScript/README.md b/00_Alternate_Languages/14_Bowling/MiniScript/README.md index e997160e..bfb33e6b 100644 --- a/00_Alternate_Languages/14_Bowling/MiniScript/README.md +++ b/00_Alternate_Languages/14_Bowling/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript bowling.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "bowling" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/15_Boxing/MiniScript/README.md b/00_Alternate_Languages/15_Boxing/MiniScript/README.md index 01454cd1..9c0ae8fc 100644 --- a/00_Alternate_Languages/15_Boxing/MiniScript/README.md +++ b/00_Alternate_Languages/15_Boxing/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript boxing.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "boxing" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/16_Bug/MiniScript/README.md b/00_Alternate_Languages/16_Bug/MiniScript/README.md index aae43e94..554d5e52 100644 --- a/00_Alternate_Languages/16_Bug/MiniScript/README.md +++ b/00_Alternate_Languages/16_Bug/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript bug.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "bug" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/17_Bullfight/MiniScript/README.md b/00_Alternate_Languages/17_Bullfight/MiniScript/README.md index c3cc69c9..2290e6e1 100644 --- a/00_Alternate_Languages/17_Bullfight/MiniScript/README.md +++ b/00_Alternate_Languages/17_Bullfight/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript bull.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "bull" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/18_Bullseye/MiniScript/README.md b/00_Alternate_Languages/18_Bullseye/MiniScript/README.md index 465e1c45..73a1c749 100644 --- a/00_Alternate_Languages/18_Bullseye/MiniScript/README.md +++ b/00_Alternate_Languages/18_Bullseye/MiniScript/README.md @@ -10,10 +10,13 @@ Go to https://miniscript.org/tryit/, clear the sample code from the code editor, 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript bullseye.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "bullseye" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/19_Bunny/MiniScript/README.md b/00_Alternate_Languages/19_Bunny/MiniScript/README.md index db1f7683..90a05433 100644 --- a/00_Alternate_Languages/19_Bunny/MiniScript/README.md +++ b/00_Alternate_Languages/19_Bunny/MiniScript/README.md @@ -10,10 +10,13 @@ Go to https://miniscript.org/tryit/, clear the sample code from the code editor, 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript bunny.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "bunny" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/20_Buzzword/MiniScript/README.md b/00_Alternate_Languages/20_Buzzword/MiniScript/README.md index db1f7683..90a05433 100644 --- a/00_Alternate_Languages/20_Buzzword/MiniScript/README.md +++ b/00_Alternate_Languages/20_Buzzword/MiniScript/README.md @@ -10,10 +10,13 @@ Go to https://miniscript.org/tryit/, clear the sample code from the code editor, 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript bunny.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "bunny" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/21_Calendar/MiniScript/README.md b/00_Alternate_Languages/21_Calendar/MiniScript/README.md index 140a5f4d..fea2264e 100644 --- a/00_Alternate_Languages/21_Calendar/MiniScript/README.md +++ b/00_Alternate_Languages/21_Calendar/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript calendar.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "calendar" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/22_Change/MiniScript/README.md b/00_Alternate_Languages/22_Change/MiniScript/README.md index f43188b9..5708156d 100644 --- a/00_Alternate_Languages/22_Change/MiniScript/README.md +++ b/00_Alternate_Languages/22_Change/MiniScript/README.md @@ -10,10 +10,13 @@ Go to https://miniscript.org/tryit/, clear the sample code from the code editor, 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript change.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "change" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/23_Checkers/MiniScript/README.md b/00_Alternate_Languages/23_Checkers/MiniScript/README.md index 1c34d8cb..9cb5fd6e 100644 --- a/00_Alternate_Languages/23_Checkers/MiniScript/README.md +++ b/00_Alternate_Languages/23_Checkers/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript checkers.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "checkers" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/24_Chemist/MiniScript/README.md b/00_Alternate_Languages/24_Chemist/MiniScript/README.md index ddc32f16..82983edc 100644 --- a/00_Alternate_Languages/24_Chemist/MiniScript/README.md +++ b/00_Alternate_Languages/24_Chemist/MiniScript/README.md @@ -10,10 +10,13 @@ Go to https://miniscript.org/tryit/, clear the sample code from the code editor, 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript chemist.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "chemist" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/25_Chief/MiniScript/README.md b/00_Alternate_Languages/25_Chief/MiniScript/README.md index 624f2817..fa28aa67 100644 --- a/00_Alternate_Languages/25_Chief/MiniScript/README.md +++ b/00_Alternate_Languages/25_Chief/MiniScript/README.md @@ -12,10 +12,13 @@ Go to https://miniscript.org/tryit/, clear the sample code from the code editor, 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript chief.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "chief" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/26_Chomp/MiniScript/README.md b/00_Alternate_Languages/26_Chomp/MiniScript/README.md index db94c503..2fce3ec7 100644 --- a/00_Alternate_Languages/26_Chomp/MiniScript/README.md +++ b/00_Alternate_Languages/26_Chomp/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript chomp.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "chomp" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/27_Civil_War/MiniScript/README.md b/00_Alternate_Languages/27_Civil_War/MiniScript/README.md index d5fd8e58..ad8e06ed 100644 --- a/00_Alternate_Languages/27_Civil_War/MiniScript/README.md +++ b/00_Alternate_Languages/27_Civil_War/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript civilwar.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "civilwar" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/28_Combat/MiniScript/README.md b/00_Alternate_Languages/28_Combat/MiniScript/README.md index d1515247..0963185f 100644 --- a/00_Alternate_Languages/28_Combat/MiniScript/README.md +++ b/00_Alternate_Languages/28_Combat/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript combat.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "combat" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/29_Craps/MiniScript/README.md b/00_Alternate_Languages/29_Craps/MiniScript/README.md index 2ecf089f..e500f4c3 100644 --- a/00_Alternate_Languages/29_Craps/MiniScript/README.md +++ b/00_Alternate_Languages/29_Craps/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript craps.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "craps" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/30_Cube/MiniScript/README.md b/00_Alternate_Languages/30_Cube/MiniScript/README.md index cca8d49d..17eeb20b 100644 --- a/00_Alternate_Languages/30_Cube/MiniScript/README.md +++ b/00_Alternate_Languages/30_Cube/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript cube.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "cube" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/31_Depth_Charge/MiniScript/README.md b/00_Alternate_Languages/31_Depth_Charge/MiniScript/README.md index d2603fae..0c20ea36 100644 --- a/00_Alternate_Languages/31_Depth_Charge/MiniScript/README.md +++ b/00_Alternate_Languages/31_Depth_Charge/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript depthcharge.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "depthcharge.ms" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/32_Diamond/MiniScript/README.md b/00_Alternate_Languages/32_Diamond/MiniScript/README.md index b8135184..3a8249a0 100644 --- a/00_Alternate_Languages/32_Diamond/MiniScript/README.md +++ b/00_Alternate_Languages/32_Diamond/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript diamond.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "diamond" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/33_Dice/MiniScript/README.md b/00_Alternate_Languages/33_Dice/MiniScript/README.md index ab9361b3..b670e30d 100644 --- a/00_Alternate_Languages/33_Dice/MiniScript/README.md +++ b/00_Alternate_Languages/33_Dice/MiniScript/README.md @@ -7,13 +7,15 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript dice.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "dice" run - +``` 3. "Try-It!" page on the web: Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of dice.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/34_Digits/MiniScript/README.md b/00_Alternate_Languages/34_Digits/MiniScript/README.md index 6936703d..280be246 100644 --- a/00_Alternate_Languages/34_Digits/MiniScript/README.md +++ b/00_Alternate_Languages/34_Digits/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript digits.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "digits" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/35_Even_Wins/MiniScript/README.md b/00_Alternate_Languages/35_Even_Wins/MiniScript/README.md index f64a21f8..d5281930 100644 --- a/00_Alternate_Languages/35_Even_Wins/MiniScript/README.md +++ b/00_Alternate_Languages/35_Even_Wins/MiniScript/README.md @@ -9,20 +9,25 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript evenwins.ms - +``` or +``` miniscript gameofevenwins.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "evenwins" run - +``` or +``` load "gameofevenwins" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/36_Flip_Flop/MiniScript/README.md b/00_Alternate_Languages/36_Flip_Flop/MiniScript/README.md index 15b42831..e012477d 100644 --- a/00_Alternate_Languages/36_Flip_Flop/MiniScript/README.md +++ b/00_Alternate_Languages/36_Flip_Flop/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript flipflop.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "flipflop" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/37_Football/MiniScript/README.md b/00_Alternate_Languages/37_Football/MiniScript/README.md index c1790a56..4d8c3306 100644 --- a/00_Alternate_Languages/37_Football/MiniScript/README.md +++ b/00_Alternate_Languages/37_Football/MiniScript/README.md @@ -7,19 +7,23 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript football.ms -or +```or +``` miniscript ftball.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "football" run -or +```or +``` load "ftball" run - +``` #### Apology from the Translator diff --git a/00_Alternate_Languages/38_Fur_Trader/MiniScript/README.md b/00_Alternate_Languages/38_Fur_Trader/MiniScript/README.md index a714f84b..3b15b992 100644 --- a/00_Alternate_Languages/38_Fur_Trader/MiniScript/README.md +++ b/00_Alternate_Languages/38_Fur_Trader/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript furtrader.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "furtrader" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/39_Golf/MiniScript/README.md b/00_Alternate_Languages/39_Golf/MiniScript/README.md index 33e39a94..8a7e5325 100644 --- a/00_Alternate_Languages/39_Golf/MiniScript/README.md +++ b/00_Alternate_Languages/39_Golf/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript golf.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "golf" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/40_Gomoko/MiniScript/README.md b/00_Alternate_Languages/40_Gomoko/MiniScript/README.md index bfd37db8..5613d133 100644 --- a/00_Alternate_Languages/40_Gomoko/MiniScript/README.md +++ b/00_Alternate_Languages/40_Gomoko/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript gomoko.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "gomoko" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/41_Guess/MiniScript/README.md b/00_Alternate_Languages/41_Guess/MiniScript/README.md index 903e75d7..bf19c759 100644 --- a/00_Alternate_Languages/41_Guess/MiniScript/README.md +++ b/00_Alternate_Languages/41_Guess/MiniScript/README.md @@ -7,13 +7,15 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript guess.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "guess" run - +``` 3. "Try-It!" page on the web: Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of guess.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/42_Gunner/MiniScript/README.md b/00_Alternate_Languages/42_Gunner/MiniScript/README.md index 6f6a5914..32349917 100644 --- a/00_Alternate_Languages/42_Gunner/MiniScript/README.md +++ b/00_Alternate_Languages/42_Gunner/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript gunner.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "gunner" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/43_Hammurabi/MiniScript/README.md b/00_Alternate_Languages/43_Hammurabi/MiniScript/README.md index 1d17e2b5..bb4411bb 100644 --- a/00_Alternate_Languages/43_Hammurabi/MiniScript/README.md +++ b/00_Alternate_Languages/43_Hammurabi/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript hammurabi.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "hammurabi" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/44_Hangman/MiniScript/README.md b/00_Alternate_Languages/44_Hangman/MiniScript/README.md index e5693849..cf8b2002 100644 --- a/00_Alternate_Languages/44_Hangman/MiniScript/README.md +++ b/00_Alternate_Languages/44_Hangman/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript hangman.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "hangman" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/45_Hello/MiniScript/README.md b/00_Alternate_Languages/45_Hello/MiniScript/README.md index c35f91c5..c3e534cb 100644 --- a/00_Alternate_Languages/45_Hello/MiniScript/README.md +++ b/00_Alternate_Languages/45_Hello/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript hello.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "hello" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/46_Hexapawn/MiniScript/README.md b/00_Alternate_Languages/46_Hexapawn/MiniScript/README.md index f6406c0d..e2cd714a 100644 --- a/00_Alternate_Languages/46_Hexapawn/MiniScript/README.md +++ b/00_Alternate_Languages/46_Hexapawn/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript hexapawn.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "hexapawn" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/47_Hi-Lo/MiniScript/README.md b/00_Alternate_Languages/47_Hi-Lo/MiniScript/README.md index 21af327d..dc20e7c8 100644 --- a/00_Alternate_Languages/47_Hi-Lo/MiniScript/README.md +++ b/00_Alternate_Languages/47_Hi-Lo/MiniScript/README.md @@ -10,10 +10,13 @@ Go to https://miniscript.org/tryit/, clear the sample code from the code editor, 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript hi-lo.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "hi-lo" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/48_High_IQ/MiniScript/README.md b/00_Alternate_Languages/48_High_IQ/MiniScript/README.md index 27d7baf8..794d1c57 100644 --- a/00_Alternate_Languages/48_High_IQ/MiniScript/README.md +++ b/00_Alternate_Languages/48_High_IQ/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript highiq.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "highiq" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/49_Hockey/MiniScript/README.md b/00_Alternate_Languages/49_Hockey/MiniScript/README.md index d350aca2..8c92997d 100644 --- a/00_Alternate_Languages/49_Hockey/MiniScript/README.md +++ b/00_Alternate_Languages/49_Hockey/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript hockey.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "hockey" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/50_Horserace/MiniScript/README.md b/00_Alternate_Languages/50_Horserace/MiniScript/README.md index c9a5cd1f..8f5703a2 100644 --- a/00_Alternate_Languages/50_Horserace/MiniScript/README.md +++ b/00_Alternate_Languages/50_Horserace/MiniScript/README.md @@ -7,14 +7,16 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript horserace.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "horserace" run - +``` ## Porting Notes diff --git a/00_Alternate_Languages/51_Hurkle/MiniScript/README.md b/00_Alternate_Languages/51_Hurkle/MiniScript/README.md index 0f4ff6a6..2f774e45 100644 --- a/00_Alternate_Languages/51_Hurkle/MiniScript/README.md +++ b/00_Alternate_Languages/51_Hurkle/MiniScript/README.md @@ -10,10 +10,13 @@ Go to https://miniscript.org/tryit/, clear the sample code from the code editor, 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript hurkle.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "hurkle" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/52_Kinema/MiniScript/README.md b/00_Alternate_Languages/52_Kinema/MiniScript/README.md index 68275b3b..173e59ad 100644 --- a/00_Alternate_Languages/52_Kinema/MiniScript/README.md +++ b/00_Alternate_Languages/52_Kinema/MiniScript/README.md @@ -7,13 +7,15 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript kinema.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "kinema" run - +``` 3. "Try-It!" page on the web: Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of kinema.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/54_Letter/MiniScript/README.md b/00_Alternate_Languages/54_Letter/MiniScript/README.md index 705e3471..dfc5cf38 100644 --- a/00_Alternate_Languages/54_Letter/MiniScript/README.md +++ b/00_Alternate_Languages/54_Letter/MiniScript/README.md @@ -7,13 +7,15 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript letter.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "letter" run - +``` 3. "Try-It!" page on the web: Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of letter.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/64_Nicomachus/MiniScript/README.md b/00_Alternate_Languages/64_Nicomachus/MiniScript/README.md index 803c9500..5ea2cf13 100644 --- a/00_Alternate_Languages/64_Nicomachus/MiniScript/README.md +++ b/00_Alternate_Languages/64_Nicomachus/MiniScript/README.md @@ -7,13 +7,15 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript nicomachus.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "nicomachus" run - +``` 3. "Try-It!" page on the web: Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of nicomachus.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/66_Number/MiniScript/README.md b/00_Alternate_Languages/66_Number/MiniScript/README.md index 769b1b46..e3c8143a 100644 --- a/00_Alternate_Languages/66_Number/MiniScript/README.md +++ b/00_Alternate_Languages/66_Number/MiniScript/README.md @@ -7,13 +7,15 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript number.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "number" run - +``` 3. "Try-It!" page on the web: Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of number.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/78_Sine_Wave/MiniScript/README.md b/00_Alternate_Languages/78_Sine_Wave/MiniScript/README.md index c2f0cb5d..a17e5cf1 100644 --- a/00_Alternate_Languages/78_Sine_Wave/MiniScript/README.md +++ b/00_Alternate_Languages/78_Sine_Wave/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript sinewave.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "sinewave" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/87_3-D_Plot/MiniScript/README.md b/00_Alternate_Languages/87_3-D_Plot/MiniScript/README.md index 817d92c0..2bcec68c 100644 --- a/00_Alternate_Languages/87_3-D_Plot/MiniScript/README.md +++ b/00_Alternate_Languages/87_3-D_Plot/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript number.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "number" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/91_Train/MiniScript/README.md b/00_Alternate_Languages/91_Train/MiniScript/README.md index 6a23b537..a1970158 100644 --- a/00_Alternate_Languages/91_Train/MiniScript/README.md +++ b/00_Alternate_Languages/91_Train/MiniScript/README.md @@ -7,13 +7,15 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript train.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "train" run - +``` 3. "Try-It!" page on the web: Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of train.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/92_Trap/MiniScript/README.md b/00_Alternate_Languages/92_Trap/MiniScript/README.md index ab157569..521d3aff 100644 --- a/00_Alternate_Languages/92_Trap/MiniScript/README.md +++ b/00_Alternate_Languages/92_Trap/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript trap.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "trap" run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/94_War/MiniScript/README.md b/00_Alternate_Languages/94_War/MiniScript/README.md index 439064b3..0d964946 100644 --- a/00_Alternate_Languages/94_War/MiniScript/README.md +++ b/00_Alternate_Languages/94_War/MiniScript/README.md @@ -7,10 +7,13 @@ Ways to play: 1. Command-Line MiniScript: Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: +``` miniscript war.ms - +``` 2. Mini Micro: Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: +``` load "war" run +``` \ No newline at end of file From e8688935bbe8ab7777484a08749e1eda1fcd2bbd Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Thu, 7 Sep 2023 12:49:54 -0700 Subject: [PATCH 15/23] Added MiniScript version of 53_King. Also updated the king_variable_update.bas with some additional variable tweaks for clarity. --- .../53_King/MiniScript/README.md | 19 + .../53_King/MiniScript/king.ms | 390 ++++++++++++++++++ .../53_King/king_variable_update.bas | 12 +- 53_King/king_variable_update.bas | 7 +- 4 files changed, 419 insertions(+), 9 deletions(-) create mode 100644 00_Alternate_Languages/53_King/MiniScript/README.md create mode 100644 00_Alternate_Languages/53_King/MiniScript/king.ms diff --git a/00_Alternate_Languages/53_King/MiniScript/README.md b/00_Alternate_Languages/53_King/MiniScript/README.md new file mode 100644 index 00000000..34818a09 --- /dev/null +++ b/00_Alternate_Languages/53_King/MiniScript/README.md @@ -0,0 +1,19 @@ +Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). + +Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +1. Command-Line MiniScript: +Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: + +``` + miniscript king.ms +``` +2. Mini Micro: +Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: + +``` + load "king" + run +``` diff --git a/00_Alternate_Languages/53_King/MiniScript/king.ms b/00_Alternate_Languages/53_King/MiniScript/king.ms new file mode 100644 index 00000000..a4ba8f3d --- /dev/null +++ b/00_Alternate_Languages/53_King/MiniScript/king.ms @@ -0,0 +1,390 @@ +print " "*34 + "KING" +print " "*15 + "Creative Computing Morristown, New Jersey" +print; print; print + +yearsRequired = 8 + +zs = input("Do you want instructions? ").lower +if zs == "again" then + // ToDo: load previous state +else if not zs or zs[0] != "n" then + print; print; print + print "Congratulations! You've just been elected premier of Setats" + print "Detinu, a small communist island 30 by 70 miles long. Your" + print "job is to decide upon the contry's budget and distribute" + print "money to your countrymen from the communal treasury." + print "The money system is rallods, and each person needs 100" + print "rallods per year to survive. Your country's income comes" + print "from farm produce and tourists visiting your magnificent" + print "forests, hunting, fishing, etc. Half your land is farm land" + print "which also has an excellent mineral content and may be sold" + print "to foreign industry (strip mining) who import and support" + print "their own workers. Crops cost between 10 and 15 rallods per" + print "square mile to plant." + print "Your goal is to complete your " + yearsRequired + " year term of office." + print "Good luck!" +end if + +print + +rallods = floor(60000+(1000*rnd)-(1000*rnd)) +countrymen = floor(500+(10*rnd)-(10*rnd)) +landArea = 2000 +foreignWorkers = 0 +sellableLandExplained = false +tourism = 0 +year = 0 + +// Bonus little feature when running in Mini Micro: display a status bar with +// key game stats at the top of the screen. +updateStatusBar = function + if version.hostName != "Mini Micro" then return + display(2).mode = displayMode.text; td = display(2) + s = " Rallods: " + (rallods + " "*8)[:8] + s += " Land: " + (landArea + " "*6)[:6] + s += " Countrymen: " + (countrymen + " "*6)[:6] + s += " Foreigners: " + (foreignWorkers + " "*5)[:5] + td.color = color.black; td.backColor = text.color + td.row = 25; td.column = 0; td.print s +end function + +min0 = function(x) + if x < 0 then return 0 else return x +end function +floorMin0 = function(x) + return min0(floor(x)) +end function +stop = function + updateStatusBar + print; print; exit +end function + +while true + landPrice = floor(10*rnd+95) + plantingArea = 0 + pollutionControl = 0 + deaths = 0 + + print + print "You now have " + rallods + " rallods in the treasury." + print floor(countrymen) + " countrymen, ", "" + costToPlant = floor(((rnd/2)*10+10)) + if foreignWorkers != 0 then + print floor(foreignWorkers) + " foreign workers, ", "" + end if + print "and " + floor(landArea) + " sq. miles of land." + print "This year industry will buy land for " + landPrice, "" + print " rallods per square mile." + print "Land currently costs " + costToPlant + " rallods per square mile to plant." + print + + updateStatusBar + while true + sellToIndustry = input("How many square miles do you wish to sell to industry? ").val + if sellToIndustry < 0 then continue + if sellToIndustry <= landArea-1000 then break + print "*** Think again. You only have " + (landArea-1000) + " square miles of farm land." + if not sellableLandExplained then + print;print "(Foreign industry will only buy farm land because" + print "forest land is uneconomical to strip mine due to trees," + print "thicker top soil, etc.)" + sellableLandExplained = true + end if + end while + landArea = floor(landArea-sellToIndustry) + rallods = floor(rallods+(sellToIndustry*landPrice)) + + updateStatusBar + while true + welfare = input("How many rallods will you distribute among your countrymen? ").val + if welfare < 0 then continue + if welfare <= rallods then break + print " Think again. You've only " + rallods + " rallods in the treasury" + end while + rallods = floor(rallods-welfare) + + updateStatusBar + while rallods > 0 + plantingArea = input("How many square miles do you wish to plant? ").val + if plantingArea < 0 then continue + if plantingArea > countrymen*2 then + print " Sorry, but each countryman can only plant 2 sq. miles." + continue + end if + if plantingArea > landArea-1000 then + print " Sorry, but you've only " + (landArea-1000) + " sq. miles of farm land." + continue + end if + plantingCost = floor(plantingArea * costToPlant) + if plantingCost <= rallods then break + print " Think again. You've only " + rallods + " rallods left in the treasury." + end while + rallods -= plantingCost + + updateStatusBar + while rallods > 0 + pollutionControl = input("How many rallods do you wish to spend on pollution control? ").val + if pollutionControl < 0 then continue + if pollutionControl <= rallods then break + print " Think again. You only have " + rallods + " rallods remaining." + end while + + if sellToIndustry == 0 and welfare == 0 and plantingArea == 0 and pollutionControl == 0 then + print + print "Goodbye." + print "(If you wish to continue this game at a later date, answer" + print "'again' when asked if you want instructions at the start" + print "of the game.)" + exit + end if + + print + print + + rallods = floor(rallods-pollutionControl) + updateStatusBar + + original_rallods = rallods + + starvationDeaths = floorMin0(countrymen - welfare/100) + if starvationDeaths then + if welfare/100 < 50 then + print + print + print "Over one third of the popultation has died since you" + print "were elected to office. The people (remaining)" + print "hate your guts." + if rnd > .5 then + print "You have been thrown out of office and are now" + print "residing in prison." + else + print "You have been assassinated." + end if + countrymen -= starvationDeaths + stop + end if + print starvationDeaths + " countrymen died of starvation" + end if + + pollutionDeaths = floorMin0(rnd*(2000-landArea)) + if pollutionControl >= 25 then + pollutionDeaths = floor(pollutionDeaths/(pollutionControl/25)) + end if + if pollutionDeaths > 0 then + print pollutionDeaths + " countrymen died of carbon-monoxide and dust inhalation" + end if + + deaths = starvationDeaths + pollutionDeaths + if deaths then + print " You were forced to spend " + floor(deaths*9), "" + print " rallods on funeral expenses" + rallods -= deaths * 9 + end if + + if rallods < 0 then + print " Insufficient reserves to cover cost - land was sold" + landArea = floorMin0(landArea+(rallods/landPrice)) + rallods = 0 + end if + + countrymen = min0(countrymen - deaths) + + if sellToIndustry then + newForeigners = floor(sellToIndustry+(rnd*10)-(rnd*20)) + if foreignWorkers == 0 then newForeigners += 20 + foreignWorkers += newForeigners + print newForeigners + " workers came to the country and ", "" + end if + + immigration = floor(((welfare/100-countrymen)/10)+(pollutionControl/25)-((2000-landArea)/50)-(pollutionDeaths/2)) + print abs(immigration) + " countrymen ", "" + if immigration < 0 then print "came to", "" else print "left", "" + print " the island." + countrymen = floorMin0(countrymen + immigration) + + cropLoss = floor(((2000-landArea)*((rnd+1.5)/2))) + if cropLoss > plantingArea then cropLoss = plantingArea + if foreignWorkers > 0 then print "Of " + floor(plantingArea) + " sq. miles planted,", "" + print " you harvested " + floor(plantingArea-cropLoss) + " sq. miles of crops." + if cropLoss then + print " (Due to air and water pollution from foreign industry.)" + end if + agriculturalIncome = floor((plantingArea-cropLoss)*(landPrice/2)) + print "Making " + agriculturalIncome + " rallods." + rallods += agriculturalIncome + + v1 = floor(((countrymen-immigration)*22)+(rnd*500)) + v2 = floor((2000-landArea)*15) + prevTourism = tourism + tourism = abs(floor(v1-v2)) + print " You made " + tourism + " rallods from tourist trade." + if v2 > 2 and tourism < prevTourism then + print " Decrease because ", "" + g1 = 10*rnd + if g1 <= 2 then + print "fish population has dwindled due to water pollution." + else if g1 <= 4 then + print "air pollution is killing game bird population." + else if g1 <= 6 then + print "mineral baths are being ruined by water pollution." + else if g1 <= 8 then + print "unpleasant smog is discouraging sun bathers." + else + print "hotels are looking shabby due to smog grit." + end if + end if + rallods += tourism + updateStatusBar + + if deaths > 200 then + print + print + print deaths + "countrymen died in one year!!!!!" + print "due to this extreme mismanagement, you have not only" + print "been impeached and thrown out of office, but you" + m6 = floor(rnd*10) + if m6 <= 3 then 1670 + if m6 <= 6 then 1680 + if m6 <= 10 then 1690 + print "also had your left eye gouged out!" + goto 1590 + print "have also gained a very bad reputation." + goto 1590 + print "have also been declared national fink." + stop + else if countrymen < 343 then + print + print + print "Over one third of the popultation has died since you" + print "were elected to office. The people (remaining)" + print "hate your guts." + if rnd > .5 then + print "You have been thrown out of office and are now" + print "residing in prison." + else + print "You have been assassinated." + end if + stop + else if (original_rallods/100) > 5 and deaths - pollutionDeaths >= 2 then + print + print "Money was left over in the treasury which you did" + print "not spend. As a result, some of your countrymen died" + print "of starvation. The public is enraged and you have" + print "been forced to either resign or commit suicide." + print "The choice is yours." + print "If you choose the latter, please turn off your computer" + print "before proceeding." + stop + else if foreignWorkers > countrymen then + print + print + print "The number of foreign workers has exceeded the number" + print "of countrymen. As a minority, they have revolted and" + print "taken over the country." + if rnd > .5 then + print "You have been thrown out of office and are now" + print "residing in prison." + else + print "You have been assassinated." + end if + stop + else if year == yearsRequired-1 then + print + print + print "Congratulations!!!!!!!!!!!!!!!!!!" + print "You have succesfully completed your " + yearsRequired + " year term" + print "of office. You were, of course, extremely lucky, but" + print "nevertheless, it's quite an achievement. Goodbye and good" + print "luck - you'll probably need it if you're the type that" + print "plays this game." + stop + end if + + updateStatusBar + wait + year += 1 +end while + +//print +//print +//print "the number of foreign workers has exceeded the number" +//print "of countrymen. as a minority, they have revolted and" +//print "taken over the country." +//if rnd<=.5 then 1580 +//print "you have been thrown out of office and are now" +//print "residing in prison." +//goto 1590 +//print "you have been assassinated." +//print +//print +//exit +//print +//print +//print deaths + "countrymen died in one year!!!!!" +//print "due to this extreme mismanagement, you have not only" +//print "been impeached and thrown out of office, but you" +//m6 = floor(rnd*10) +//if m6 <= 3 then 1670 +//if m6 <= 6 then 1680 +//if m6 <= 10 then 1690 +//print "also had your left eye gouged out!" +//goto 1590 +//print "have also gained a very bad reputation." +//goto 1590 +//print "have also been declared national fink." +//goto 1590 +// +//print +//print +//print "over one third of the popultation has died since you" +//print "were elected to office. the people (remaining)" +//print "hate your guts." +//goto 1570 +//if deaths-pollutionDeaths < 2 then 1515 +//print +//print "money was left over in the treasury which you did" +//print "not spend. as a result, some of your countrymen died" +//print "of starvation. the public is enraged and you have" +//print "been forced to either resign or commit suicide." +//print "the choice is yours." +//print "if you choose the latter, please turn off your computer" +//print "before proceeding." +//goto 1590 +//print +//print +//print "congratulations!!!!!!!!!!!!!!!!!!" +//print "you have succesfully completed your" + yearsRequired + "year term" +//print "of office. you were, of course, extremely lucky, but" +//print "nevertheless, it's quite an achievement. goodbye and good" +//print "luck - you'll probably need it if you're the type that" +//print "plays this game." +//goto 1590 +// +//print "how many years had you been in office when interrupted"; +//input year +//if year < 0 then 1590 +//if year < 8 then 1969 +//print " come on, your term in office is only" + yearsRequired + "years." +//goto 1960 +//print "how much did you have in the treasury"; +//input rallods +//if rallods < 0 then 1590 +//print "how many countrymen"; +//input countrymen +//if countrymen < 0 then 1590 +//print "how many workers"; +//input foreignWorkers +//if foreignWorkers < 0 then 1590 +//print "how many square miles of land"; +//input landArea +//if landArea < 0 then 1590 +//if landArea > 2000 then 1996 +//if landArea > 1000 then 100 +//print " come on, you started with 1000 sq. miles of farm land" +//print " and 10,000 sq. miles of forest land." +//goto 1990 +// +//year = year+1 +//deaths = 0 +//goto 100 +//end diff --git a/00_Alternate_Languages/53_King/king_variable_update.bas b/00_Alternate_Languages/53_King/king_variable_update.bas index 7f88e101..86c3828c 100644 --- a/00_Alternate_Languages/53_King/king_variable_update.bas +++ b/00_Alternate_Languages/53_King/king_variable_update.bas @@ -8,7 +8,7 @@ 11 IF Z$="AGAIN" THEN 1960 12 PRINT:PRINT:PRINT 20 PRINT "CONGRATULATIONS! YOU'VE JUST BEEN ELECTED PREMIER OF SETATS" - 22 PRINT "DETINU, RALLODS SMALL COMMUNIST ISLAND 30 BY 70 MILES LONG. YOUR" + 22 PRINT "DETINU, A SMALL COMMUNIST ISLAND 30 BY 70 MILES LONG. YOUR" 24 PRINT "JOB IS TO DECIDE UPON THE CONTRY'S BUDGET AND DISTRIBUTE" 26 PRINT "MONEY TO YOUR COUNTRYMEN FROM THE COMMUNAL TREASURY." 28 PRINT "THE MONEY SYSTEM IS RALLODS, AND EACH PERSON NEEDS 100" @@ -219,7 +219,7 @@ REM I think tourism calculations are actually wrong in the original code! 1505 IF COUNTRYMEN<343 THEN 1700 1510 IF (ORIGINAL_RALLODS/100)>5 THEN 1800 1515 IF FOREIGN_WORKERS>COUNTRYMEN THEN 1550 -1520 IF YEARS_REQUIRED-1=X5 THEN 1900 +1520 IF YEARS_REQUIRED-1=YEAR THEN 1900 1545 GOTO 2000 1550 PRINT 1552 PRINT @@ -277,9 +277,9 @@ REM I think tourism calculations are actually wrong in the original code! 1950 GOTO 1590 1960 PRINT "HOW MANY YEARS HAD YOU BEEN IN OFFICE WHEN INTERRUPTED"; -1961 INPUT X5 -1962 IF X5<0 THEN 1590 -1963 IF X5<8 THEN 1969 +1961 INPUT YEAR +1962 IF YEAR<0 THEN 1590 +1963 IF YEAR<8 THEN 1969 1965 PRINT " COME ON, YOUR TERM IN OFFICE IS ONLY";YEARS_REQUIRED;"YEARS." 1967 GOTO 1960 1969 PRINT "HOW MUCH DID YOU HAVE IN THE TREASURY"; @@ -300,7 +300,7 @@ REM I think tourism calculations are actually wrong in the original code! 1997 PRINT " AND 10,000 SQ. MILES OF FOREST LAND." 1998 GOTO 1990 -2000 X5=X5+1 +2000 YEAR=YEAR+1 2020 DEATHS=0 2040 GOTO 100 2046 END diff --git a/53_King/king_variable_update.bas b/53_King/king_variable_update.bas index 7f88e101..0ae19de4 100644 --- a/53_King/king_variable_update.bas +++ b/53_King/king_variable_update.bas @@ -8,7 +8,7 @@ 11 IF Z$="AGAIN" THEN 1960 12 PRINT:PRINT:PRINT 20 PRINT "CONGRATULATIONS! YOU'VE JUST BEEN ELECTED PREMIER OF SETATS" - 22 PRINT "DETINU, RALLODS SMALL COMMUNIST ISLAND 30 BY 70 MILES LONG. YOUR" + 22 PRINT "DETINU, A SMALL COMMUNIST ISLAND 30 BY 70 MILES LONG. YOUR" 24 PRINT "JOB IS TO DECIDE UPON THE CONTRY'S BUDGET AND DISTRIBUTE" 26 PRINT "MONEY TO YOUR COUNTRYMEN FROM THE COMMUNAL TREASURY." 28 PRINT "THE MONEY SYSTEM IS RALLODS, AND EACH PERSON NEEDS 100" @@ -66,7 +66,8 @@ 380 PLANTING_AREA=0 390 MONEY_SPENT_ON_POLLUTION_CONTROL=0 395 RALLODS=0 -399 GOTO 1000 +399 GOTO 600 + 400 RALLODS=INT(RALLODS-WELFARE) 410 PRINT "HOW MANY SQUARE MILES DO YOU WISH TO PLANT"; @@ -88,7 +89,7 @@ 490 MONEY_SPENT_ON_POLLUTION_CONTROL=0 495 RALLODS=0 -499 GOTO 1000 +499 GOTO 600 500 RALLODS=RALLODS-MONEY_SPENT_ON_PLANTING From d16e1fd213a4e8820d94c19ae9c026a23c0bb61d Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Thu, 7 Sep 2023 13:05:03 -0700 Subject: [PATCH 16/23] Finished 53_King program with "resume game" feature. --- .../53_King/MiniScript/king.ms | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/00_Alternate_Languages/53_King/MiniScript/king.ms b/00_Alternate_Languages/53_King/MiniScript/king.ms index a4ba8f3d..8d4f106c 100644 --- a/00_Alternate_Languages/53_King/MiniScript/king.ms +++ b/00_Alternate_Languages/53_King/MiniScript/king.ms @@ -3,10 +3,30 @@ print " "*15 + "Creative Computing Morristown, New Jersey" print; print; print yearsRequired = 8 +rallods = floor(60000+(1000*rnd)-(1000*rnd)) +countrymen = floor(500+(10*rnd)-(10*rnd)) +landArea = 2000 +foreignWorkers = 0 +sellableLandExplained = false +tourism = 0 +year = 0 zs = input("Do you want instructions? ").lower if zs == "again" then - // ToDo: load previous state + while true + year = input("How many years had you been in office when interrupted? ").val + if 0 <= year < yearsRequired then break + print " Come on, your term in office is only " + yearsRequired + " years." + end while + rallods = input("How much did you have in the treasury? ").val + countrymen = input("How many countrymen? ").val + foreignWorkers = input("How many foreign workers? ").val + while true + landArea = input("How many square miles of land? ").val + if 1000 <= landArea <= 2000 then break + print " Come on, you started with 1000 sq. miles of farm land" + print " and 1000 sq. miles of forest land." + end while else if not zs or zs[0] != "n" then print; print; print print "Congratulations! You've just been elected premier of Setats" @@ -27,13 +47,6 @@ end if print -rallods = floor(60000+(1000*rnd)-(1000*rnd)) -countrymen = floor(500+(10*rnd)-(10*rnd)) -landArea = 2000 -foreignWorkers = 0 -sellableLandExplained = false -tourism = 0 -year = 0 // Bonus little feature when running in Mini Micro: display a status bar with // key game stats at the top of the screen. From 8fe02cc22ddce4b9ba8f4f68035ddbbb2b0a0d0c Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Fri, 8 Sep 2023 08:12:57 -0700 Subject: [PATCH 17/23] Added MiniScript version of 55_Life. --- 55_Life/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/55_Life/README.md b/55_Life/README.md index 1834c1e6..195bd795 100644 --- a/55_Life/README.md +++ b/55_Life/README.md @@ -37,4 +37,11 @@ http://www.vintage-basic.net/games.html #### Porting Notes +- To make sense of the code, it's important to understand what the values in the A(X,Y) array mean: + - 0: dead cell + - 1: live cell + - 2: currently live, but dead next cycle + - 3: currently dead, but alive next cycle + + (please note any difficulties or challenges in porting here) From 7753f6bf132c9b855cc7be17824e47ebef1f1e0c Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Sun, 10 Sep 2023 15:33:30 -0700 Subject: [PATCH 18/23] Added MiniScript versions of 55_Life and 56_Life_for_Two. --- .../55_Life/MiniScript/README.md | 19 +++ .../55_Life/MiniScript/life.ms | 132 ++++++++++++++++++ .../56_Life_for_Two/MiniScript/README.md | 19 +++ .../56_Life_for_Two/MiniScript/lifefortwo.ms | 129 +++++++++++++++++ 56_Life_for_Two/README.md | 3 +- 5 files changed, 301 insertions(+), 1 deletion(-) create mode 100644 00_Alternate_Languages/55_Life/MiniScript/README.md create mode 100644 00_Alternate_Languages/55_Life/MiniScript/life.ms create mode 100644 00_Alternate_Languages/56_Life_for_Two/MiniScript/README.md create mode 100644 00_Alternate_Languages/56_Life_for_Two/MiniScript/lifefortwo.ms diff --git a/00_Alternate_Languages/55_Life/MiniScript/README.md b/00_Alternate_Languages/55_Life/MiniScript/README.md new file mode 100644 index 00000000..4cfd557b --- /dev/null +++ b/00_Alternate_Languages/55_Life/MiniScript/README.md @@ -0,0 +1,19 @@ +Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). + +Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +1. Command-Line MiniScript: +Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: + +``` + miniscript life.ms +``` +2. Mini Micro: +Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: + +``` + load "life" + run +``` diff --git a/00_Alternate_Languages/55_Life/MiniScript/life.ms b/00_Alternate_Languages/55_Life/MiniScript/life.ms new file mode 100644 index 00000000..69f3bafc --- /dev/null +++ b/00_Alternate_Languages/55_Life/MiniScript/life.ms @@ -0,0 +1,132 @@ +print " "*34 + "LIFE" +print " "*15 + "Creative Computing Morristown, New Jersey" +print; print; print +import "listUtil" // (needed for list.init2d) + +maxx = 66 // (size adjusted for Mini Micro display) +maxy = 23 +A = list.init2d(maxx+1, maxy+1, 0) + +// Stuff the given pattern into the center of the cell array. +// Return the number of live cells. +stuffIntoCenter = function(pattern) + maxLen = 0 + for p in pattern + if p.len > maxLen then maxLen = p.len + end for + + population = 0 + y = floor(maxy/2 - pattern.len/2) + for row in pattern + x = floor(maxx/2 - maxLen/2) + for c in row + if c != " " then + A[x][y] = 1 + population += 1 + end if + x += 1 + end for + y += 1 + end for + return population +end function + +// Get the initial pattern from the user +initToUserPattern = function + print "Enter your pattern (enter DONE when done):" + userPattern = [] + while true + p = input("?") + if p.upper == "DONE" then break + if p and p[0] == "." then p = " " + p[1:] + userPattern.push p + end while + return stuffIntoCenter(userPattern) +end function + +// For testing purposes, skip asking the user and just use a hard-coded pattern. +initToStandardPattern = function + pattern = [ + " **", + " * *", + " *"] + return stuffIntoCenter(pattern) +end function + +// Or, just for fun, initialize to a random pattern of junk in the center. +initRandom = function + for x in range(ceil(maxx*0.3), floor(maxx*0.7)) + for y in range(ceil(maxy*0.3), floor(maxy*0.7)) + A[x][y] = rnd > 0.5 + end for + end for +end function + +// Define a function to draw the current game state. +// This also changes 2 (dying) to 0 (dead), and 3 (being born) to 1 (alive). +drawGameState = function(generation=0, population=0, invalid=false) + if version.hostName == "Mini Micro" then text.row = 26 else print + print "Generation: " + generation + " Population: " + population + + " " + "INVALID!" * invalid + for y in range(0, maxy) + s = "" + for x in range(0, maxx) + if A[x][y] == 2 then + A[x][y] = 0 + else if A[x][y] == 3 then + A[x][y] = 1 + end if + if A[x][y] then s += "*" else s += " " + end for + print s + end for +end function + +// Update the game state, setting cells that should be born to 3 and +// cells that should die to 2. Return the number of cells that will +// be alive after this update. Also, set globals.invalid if any live +// cells are found on the edge of the map. +updateGameState = function + population = 0 + for x in range(0, maxx) + for y in range(0, maxy) + c = A[x][y] == 1 or A[x][y] == 2 // center state + n = -c // number of neighbors + for nx in range(x-1, x+1) + if nx < 0 or nx > maxx then continue + for ny in range(y-1, y+1) + if ny < 0 or ny > maxy then continue + n += A[nx][ny] == 1 or A[nx][ny] == 2 + end for + end for + if c and n != 2 and n != 3 then // live cell with < 2 or > 3 neighbors... + A[x][y] = 2 // dies + else if not c and n == 3 then // dead cell with 3 neighbors... + A[x][y] = 3 // comes to life + if x == 0 or x == maxx or y == 0 or y == maxy then + globals.invalid = true + end if + end if + population += (A[x][y] == 1 or A[x][y] == 3) + end for + end for + return population +end function + + +// Initialize the game state (uncomment one of the following three lines) +population = initToUserPattern +//population = initToStandardPattern +//population = initRandom + +// Main loop +if version.hostName == "Mini Micro" then clear +invalid = false +generation = 0 +while population > 0 + drawGameState generation, population, invalid + population = updateGameState + generation += 1 + //key.get // <-- Uncomment this to single-step with each keypress! +end while +drawGameState generation, population, invalid diff --git a/00_Alternate_Languages/56_Life_for_Two/MiniScript/README.md b/00_Alternate_Languages/56_Life_for_Two/MiniScript/README.md new file mode 100644 index 00000000..93b25b99 --- /dev/null +++ b/00_Alternate_Languages/56_Life_for_Two/MiniScript/README.md @@ -0,0 +1,19 @@ +Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). + +Conversion to [MiniScript](https://miniscript.org). The only liberty I took with the original design is that, when prompting each player for their turn, I include a reminder of what symbol (* or #) represents their pieces on the board. + +Ways to play: + +1. Command-Line MiniScript: +Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: + +``` + miniscript lifefortwo.ms +``` +2. Mini Micro: +Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: + +``` + load "lifefortwo" + run +``` diff --git a/00_Alternate_Languages/56_Life_for_Two/MiniScript/lifefortwo.ms b/00_Alternate_Languages/56_Life_for_Two/MiniScript/lifefortwo.ms new file mode 100644 index 00000000..49ac531e --- /dev/null +++ b/00_Alternate_Languages/56_Life_for_Two/MiniScript/lifefortwo.ms @@ -0,0 +1,129 @@ +print " "*33 + "LIFE2" +print " "*15 + "Creative Computing Morristown, New Jersey" +print; print; print +print " "*10 + "U.B. LIFE GAME" + +// N: counts neighbors and game state, as follows: +// 1's digit: player 1 neighbors +// 10's digit: player 2 neighbors +// 100's digit: player 1 current live cell +// 1000's digit: player 2 current live cell +N = [] +for i in range(0,6); N.push [0]*7; end for + +// K: encodes the rule for what cells come to life, based on +// the value in N. The first 9 entries mean new life for Player 1; +// the second 9 entries mean new life for Player 2. +K = [3,102,103,120,130,121,112,111,12, + 21,30,1020,1030,1011,1021,1003,1002,1012] + +// population: how many live cells each player (1-2) has +population = [null, 0, 0] + +// Function to get input coordinates from the player, for any empty space. +// Where possible, hide the input so the other player can't see it. +getCoords = function + while true + print "X,Y" + inp = input.replace(",", " ").replace(" "," ") + if version.hostName == "Mini Micro" then + text.row = text.row + 1; print " "*60 + end if + parts = inp.split + if parts.len == 2 then + x = parts[0].val + y = parts[1].val + if 0 < x <= 5 and 0 < y <= 5 and N[x][y] == 0 then break + end if + print "Illegal coords. Retype" + end while + return [x, y] +end function + +// Function to print the board. At the same time, it replaces +// any player 1 value (as judged by list K) with 100, and any +// player 2 value with 1000. Also update population[] with the +// number of pieces of each player. +printBoard = function + population[1] = 0 + population[2] = 0 + for y in range(0, 6) + if y == 0 or y == 6 then + print " 0 1 2 3 4 5 0" + else + print " " + y, " " + for x in range(1, 5) + kIndex = K.indexOf(N[x][y]) + if kIndex == null then + print " ", " " + N[x][y] = 0 + else if kIndex < 9 then + print "*", " " + N[x][y] = 100 + population[1] += 1 + else + print "#", " " + N[x][y] = 1000 + population[2] += 1 + end if + end for + print y + end if + end for + print +end function + +// Function to update the board (N). +updateBoard = function + for j in range(1,5) + for k in range(1,5) + if N[j][k] < 100 then continue // not a live cell + if N[j][k] > 999 then value = 10 else value = 1 + for x in range(j-1, j+1) + for y in range(k-1, k+1) + if x == j and y == k then continue + N[x][y] += value + //if [x,y] == [2,1] then print "adding " + value + " from " + j+","+k + " to " + x+","+y + ", --> " + N[x][y] + end for + end for + end for + end for +end function + + +// Get initial player positions. +for player in [1,2] + print; print "Player " + player + " - 3 live pieces." + if player == 2 then value = 30 else value = 3 + for k in range(1,3) + pos = getCoords + N[pos[0]][pos[1]] = value + end for +end for + +printBoard +while true + updateBoard + printBoard + if population[1] == 0 and population[2] == 0 then + print "A DRAW" + break + else if population[1] == 0 then + print "PLAYER 2 IS THE WINNER" + break + else if population[2] == 0 then + print "PLAYER 1 IS THE WINNER" + break + end if + + print; print "Player 1 (*)" + p1pos = getCoords + print; print "Player 2 (#)" + p2pos = getCoords + if p1pos == p2pos then + print "Same coord. Set to 0" + else + N[p1pos[0]][p1pos[1]] = 100 + N[p2pos[0]][p2pos[1]] = 1000 + end if +end while \ No newline at end of file diff --git a/56_Life_for_Two/README.md b/56_Life_for_Two/README.md index e68c8d64..5ce081d3 100644 --- a/56_Life_for_Two/README.md +++ b/56_Life_for_Two/README.md @@ -26,7 +26,7 @@ A new cell will be generated at (3,3) which will be a `#` since there are two `# | 4 | | | | | | | 5 | | | | | | ``` -On the first most each player positions 3 pieces of life on the board by typing in the co-ordinates of the pieces. (In the event of the same cell being chosen by both players that cell is left empty.) +On the first move each player positions 3 pieces of life on the board by typing in the co-ordinates of the pieces. (In the event of the same cell being chosen by both players that cell is left empty.) The board is then adjusted to the next generation and printed out. @@ -45,6 +45,7 @@ As published in Basic Computer Games (1978): Downloaded from Vintage Basic at http://www.vintage-basic.net/games.html + #### Porting Notes (please note any difficulties or challenges in porting here) From f62b9864bcfe37d0aa7288cd048100d5c60ee191 Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Sun, 10 Sep 2023 15:45:05 -0700 Subject: [PATCH 19/23] Added MiniScript version of 57_Literature_Quiz. --- .../57_Literature_Quiz/MiniScript/README.md | 22 +++++++ .../57_Literature_Quiz/MiniScript/litquiz.ms | 66 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 00_Alternate_Languages/57_Literature_Quiz/MiniScript/README.md create mode 100644 00_Alternate_Languages/57_Literature_Quiz/MiniScript/litquiz.ms diff --git a/00_Alternate_Languages/57_Literature_Quiz/MiniScript/README.md b/00_Alternate_Languages/57_Literature_Quiz/MiniScript/README.md new file mode 100644 index 00000000..e3f12eb4 --- /dev/null +++ b/00_Alternate_Languages/57_Literature_Quiz/MiniScript/README.md @@ -0,0 +1,22 @@ +Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). + +Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +0. Try-It! Page: +Go to https://miniscript.org/tryit/, clear the sample code from the code editor, and paste in the contents of litquiz.ms. Then click the "Run Script" button. Program output (and input) will appear in the green-on-black terminal display to the right of or below the code editor. + +1. Command-Line MiniScript: +Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: + +``` + miniscript litquiz.ms +``` +2. Mini Micro: +Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: + +``` + load "litquiz" + run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/57_Literature_Quiz/MiniScript/litquiz.ms b/00_Alternate_Languages/57_Literature_Quiz/MiniScript/litquiz.ms new file mode 100644 index 00000000..e465cc6b --- /dev/null +++ b/00_Alternate_Languages/57_Literature_Quiz/MiniScript/litquiz.ms @@ -0,0 +1,66 @@ +print " "*24 + "Literature Quiz" +print " "*15 + "Creative Computing Morristown, New Jersey" +print; print; print + +r=0 +print "Test your knowledge of children's literature." +print; print "This is a multiple-choice quiz." +print "Type a 1, 2, 3, or 4 after the question mark." +print; print "Good luck!"; + +print; print +print "In pinocchio, what was the name of the cat?" +print "1)Tigger, 2)Cicero, 3)Figaro, 4)Fuipetto"; +a = input("?").val +if a!=3 then + print "Sorry...Figaro was his name." +else + print "Very good! Here's another." + r += 1 +end if + +print; print +print "From whose garden did Bugs Bunny steal the carrots?" +print "1)Mr. Nixon's, 2)Elmer Fudd's, 3)Clem Judd's, 4)Stromboli's"; +a = input("?").val +if a != 2 then + print "Too bad...it was elmer fudd's garden." +else + print "Pretty good!" + r += 1 +end if + +print; print +print "In the Wizard of Oz, Dorothy's dog was named" +print "1)Cicero, 2)Trixia, 3)King, 4)Toto"; +a = input("?").val +if a != 4 then + print "Back to the books,...Toto was his name." +else + print "Yea! You're a real literature giant." + r += 1 +end if + +print;print +print "Who was the fair maiden who ate the poison apple?" +print "1)Sleeping Beauty, 2)Cinderella, 3)Snow White, 4)Wendy"; +a = input("?").val +if a != 3 then + print "Oh, come on now...it was Snow White." +else + print "Good memory!" + r += 1 +end if + +print;print +if r == 4 then + print "Wow! That's super! You really know your nursery" + print "Your next quiz will be on 2nd century Chinese" + print "literature (ha, ha, ha)" +else if r<2 then + print "Ugh. That was definitely not too swift. Back to" + print "nursery school for you, my friend." +else + print "Not bad, but you might spend a little more time" + print "reading the nursery greats." +end if From 81ed4f3f1e9f8e069a39bbbef9909e269beeeb93 Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Sun, 10 Sep 2023 16:05:13 -0700 Subject: [PATCH 20/23] Added MiniScript version of 58_Love. --- .../58_Love/MiniScript/README.md | 22 ++++++++++ .../58_Love/MiniScript/love.ms | 41 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 00_Alternate_Languages/58_Love/MiniScript/README.md create mode 100644 00_Alternate_Languages/58_Love/MiniScript/love.ms diff --git a/00_Alternate_Languages/58_Love/MiniScript/README.md b/00_Alternate_Languages/58_Love/MiniScript/README.md new file mode 100644 index 00000000..1186963d --- /dev/null +++ b/00_Alternate_Languages/58_Love/MiniScript/README.md @@ -0,0 +1,22 @@ +Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). + +Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +0. Try-It! Page: +Go to https://miniscript.org/tryit/, clear the sample code from the code editor, and paste in the contents of love.ms. Then click the "Run Script" button. Program output (and input) will appear in the green-on-black terminal display to the right of or below the code editor. + +1. Command-Line MiniScript: +Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: + +``` + miniscript love.ms +``` +2. Mini Micro: +Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: + +``` + load "love" + run +``` \ No newline at end of file diff --git a/00_Alternate_Languages/58_Love/MiniScript/love.ms b/00_Alternate_Languages/58_Love/MiniScript/love.ms new file mode 100644 index 00000000..64693f12 --- /dev/null +++ b/00_Alternate_Languages/58_Love/MiniScript/love.ms @@ -0,0 +1,41 @@ +print " "*33 + "LOVE" +print " "*15 + "Creative Computing Morristown, New Jersey" +print; print; print + +print "A tribute to the great american artist, Robert Indiana." +print "His greatest work will be reproduced with a message of" +print "your choice up to 60 characters. If you can't think of" +print "a message, simple type the word 'LOVE'"; print +msg = input("Your message, please? ") +for i in range(1, 10); print; end for + +repeatedMsg = msg * ceil(60 / msg.len) + +data = [] +data += [60,1,12,26,9,12,3,8,24,17,8,4,6,23,21,6,4,6,22,12,5,6,5] +data += [4,6,21,11,8,6,4,4,6,21,10,10,5,4,4,6,21,9,11,5,4] +data += [4,6,21,8,11,6,4,4,6,21,7,11,7,4,4,6,21,6,11,8,4] +data += [4,6,19,1,1,5,11,9,4,4,6,19,1,1,5,10,10,4,4,6,18,2,1,6,8,11,4] +data += [4,6,17,3,1,7,5,13,4,4,6,15,5,2,23,5,1,29,5,17,8] +data += [1,29,9,9,12,1,13,5,40,1,1,13,5,40,1,4,6,13,3,10,6,12,5,1] +data += [5,6,11,3,11,6,14,3,1,5,6,11,3,11,6,15,2,1] +data += [6,6,9,3,12,6,16,1,1,6,6,9,3,12,6,7,1,10] +data += [7,6,7,3,13,6,6,2,10,7,6,7,3,13,14,10,8,6,5,3,14,6,6,2,10] +data += [8,6,5,3,14,6,7,1,10,9,6,3,3,15,6,16,1,1] +data += [9,6,3,3,15,6,15,2,1,10,6,1,3,16,6,14,3,1,10,10,16,6,12,5,1] +data += [11,8,13,27,1,11,8,13,27,1,60] + +for row in range(0, 35) + s = [] + a1 = 0; p = true + while a1 < 60 + a = data.pull + a1 += a + for i in range(a1-a, a1-1) + s.push repeatedMsg[i] * p + " " * (not p) + end for + p = not p + end while + print s.join("") + wait 0.1 // OPTIONAL; slows printing down so you can see it all +end for From ae81f67e2d5330128be207053bff1e6811dae0e4 Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Mon, 11 Sep 2023 09:32:32 -0700 Subject: [PATCH 21/23] Added MiniScript version of 59_Lunar_LEM_Rocket, "lem" program. (Still need to do the other two in this folder.) --- .../59_Lunar_LEM_Rocket/MiniScript/README.md | 19 + .../59_Lunar_LEM_Rocket/MiniScript/lem.ms | 324 ++++++++++++++++++ 59_Lunar_LEM_Rocket/README.md | 9 + 3 files changed, 352 insertions(+) create mode 100644 00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/README.md create mode 100644 00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/lem.ms diff --git a/00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/README.md b/00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/README.md new file mode 100644 index 00000000..6ba18136 --- /dev/null +++ b/00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/README.md @@ -0,0 +1,19 @@ +Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). + +Conversion to [MiniScript](https://miniscript.org). Note that there are three different programs in this folder, all variations on the "land the LEM on the Moon" idea. + +Ways to play: + +1. Command-Line MiniScript: +Download for your system from https://miniscript.org/cmdline/, install, and then run the desired program with a command such as: + +``` + miniscript lem.ms +``` +2. Mini Micro: +Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the MiniScript program and this README file. Then, at the Mini Micro command prompt, enter: + +``` + load "lem" // (or "lunar" or "rocket") + run +``` diff --git a/00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/lem.ms b/00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/lem.ms new file mode 100644 index 00000000..92a263e2 --- /dev/null +++ b/00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/lem.ms @@ -0,0 +1,324 @@ +print " "*34 + "LEM" +print " "*15 + "Creative Computing Morristown, New Jersey" +// rockt2 is an interactive game that simulates a lunar +// landing is similar to that of the apollo program. +// There is absolutely no chance involved + + +printIntro = function + print + print " You are on a lunar landing mission. as the pilot of" + print "the lunar excursion module, you will be expected to" + print "give certain commands to the module navigation system." + print "The on-board computer will give a running account" + print "of information needed to navigate the ship." + print + input "(Press Return.)" + print + print "The attitude angle called for is described as follows." + print "+ or -180 degrees is directly away from the moon" + print "-90 degrees is on a tangent in the direction of orbit" + print "+90 degrees is on a tangent from the direction of orbit" + print "0 (zero) degrees is directly toward the moon" + print + print " "*30 + "-180|+180" + print " "*34 + "^" + print " "*27 + "-90 < -+- > +90" + print " "*34 + "!" + print " "*34 + "0" + print " "*21 + "<<<< direction of orbit <<<<" + print + print " "*20 + "------ surface of moon ------" + print + input + print + print "All angles between -180 and +180 degrees are accepted." + print + print "1 fuel unit = 1 sec. at max thrust" + print "Any discrepancies are accounted for in the use of fuel" + print "for an attitude change." + print "Available engine power: 0 (zero) and any value between" + print "10 and 100 percent." + print + print "Negative thrust or time is prohibited." + print + input +end function + +printInOutInfo = function(withExample = true) + print + print "Input: time interval in seconds ------ (T)" + print " percentage of thrust ---------- (P)" + print " attitude angle in degrees ----- (A)" + print + if withExample then + print "For example:" + print "T,P,A? 10,65,-60" + print "To abort the mission at any time, enter 0,0,0" + print + end if + print "Output: total time in elapsed seconds" + print " height in " + ms + print " distance from landing site in " + ms + print " vertical velocity in " + ms + "/second" + print " horizontal velocity in " + ms + "/second" + print " fuel units remaining" + print +end function + +initState = function + globals.m = 17.95 + globals.f1 = 5.25 + globals.n = 7.5 + globals.r0 = 926 + globals.v0 = 1.29 + globals.t = 0 + globals.h0 = 60 + globals.r = r0+h0 + globals.a = -3.425 + globals.r1 = 0 + globals.a1 = 8.84361e-04 + globals.r3 = 0 + globals.a3 = 0 + globals.m1 = 7.45 + globals.m0 = m1 + globals.b = 750 + globals.t1 = 0 + globals.f = 0 + globals.p = 0 + globals.n = 1 + globals.m2 = 0 + globals.s = 0 + globals.c = 0 +end function + +getUnits = function(moreHelp=true) + print + while true + print "Input measurement option number? ", "" + if moreHelp then + print + print "Which system of measurement do you prefer?" + print " 1 = metric 0 = english" + print "Enter the appropriate number? ", "" + end if + k = input.val + if k == 0 then + globals.z = 6080 + globals.ms = "feet" + globals.g3 = .592 + globals.ns = "n.miles" + globals.g5 = z + break + else if k == 1 then + globals.z = 1852.8 + globals.ms="meters" + globals.g3 = 3.6 + globals.ns=" kilometers" + globals.g5 = 1000 + break + end if + moreHelp = true + end while +end function + +startFirstGame = function + initState + print + print "Lunar Landing Simulation" + print + print "Have you flown an Apollo/LEM mission before", "" + while true + qs = input(" (yes or no)? ").lower + if qs and (qs[0] == "y" or qs[0] == "n") then break + print "Just answer the question, please, ", "" + end while + getUnits (qs[0] == "n") + if qs[0] == "n" then printIntro + printInOutInfo +end function + +startSubsequentGame = function + initState + print + print "OK, do you want the complete instructions or the input -" + print "output statements?" + while true + print "1 = complete instructions" + print "2 = input-output statements" + print "3 = neither" + b1 = input.val + if 1 <= b1 <= 3 then break + end while + if b1 == 1 then printIntro + if b1 < 3 then printInOutInfo +end function + +getTurnInputs = function + while true + print + inp = input("T,P,A? ").replace(",", " ").replace(" ", " ").split + if inp.len != 3 then continue + globals.t1 = inp[0].val // NOTE: though we prompt for T, P, A, + globals.f = inp[1].val // internally these are t1, f, and p respectively. + globals.p = inp[2].val + globals.f = f/100 + if t1 < 0 then + print + print "This spacecraft is not able to violate the space-"; + print "time continuum." + continue + else if t1 == 0 then + return // abort mission + end if + if f < 0 or f > 1.05 or abs(f-.05) < .05 then + print + print "Impossible thrust value: ", "" + if f < 0 then + print "negative" + else if f < 0.5 then + print "too small" + else + print "too large" + end if + continue + end if + if abs(p) > 180 then + print + print "If you want to spin around, go outside the module" + print "for an E.V.A." + continue + end if + return + end while +end function + +pad = function(num, width=10) + anum = abs(num) + if anum >= 10000 then + s = round(num) + else if anum >= 10000 then + s = round(num, 1) + else if anum > 100 then + s = round(num, 2) + else + s = round(num, 3) + end if + return (s + " " * width)[:width] +end function + +integrate = function + n = 20 + if t1 >= 400 then n = t1/20 + globals.t1 = t1/n + globals.p = p*3.14159/180 + s = sin(p) + c = cos(p) + globals.m2 = m0*t1*f/b + globals.r3 = -.5*r0*((v0/r)^2)+r*a1*a1 + globals.a3 = -2*r1*a1/r + + for i in range(1, n) + if m1 != 0 then + globals.m1 = m1-m2 + if m1<=0 then + globals.f = f*(1+m1/m2) + globals.m2 = m1+m2 + print "You are out of fuel." + globals.m1 = 0 + end if + else + globals.f = 0 + globals.m2 = 0 + end if + globals.m = m-.5*m2 + globals.r4 = r3 + globals.r3 = -.5*r0*((v0/r)^2)+r*a1*a1 + globals.r2 = (3*r3-r4)/2+.00526*f1*f*c/m + globals.a4 = a3 + globals.a3 = -2*r1*a1/r + globals.a2 = (3*a3-a4)/2+.0056*f1*f*s/(m*r) + globals.x = r1*t1+.5*r2*t1*t1 + globals.r = r+x + globals.h0 = h0+x + globals.r1 = r1+r2*t1 + globals.a = a+a1*t1+.5*a2*t1*t1 + globals.a1 = a1+a2*t1 + globals.m = m-.5*m2 + globals.t = t+t1 + if h0<3.287828e-04 then break + end for + + globals.h = h0*z + globals.h1 = r1*z + globals.d = r0*a*z + globals.d1 = r*a1*z + globals.t2 = m1*b/m0 + + print " " + [pad(t, 10), pad(h, 10), pad(d, 10), pad(h1, 10), pad(d1, 10), pad(t2, 10)].join +end function + +// Do one turn of the game. Return true if game still in progress, +// or false when game is over (aborted, crashed, or landed). +doOneTurn = function + if m1 == 0 then + // out of fuel! + globals.t1 = 20 + globals.f = 0 + globals.p = 0 + else + getTurnInputs + end if + if t1 == 0 then + print "Mission abended" + return false + end if + integrate + + if h0 < 3.287828e-04 then + if r1 < -8.21957e-04 or abs(r*a1) > 4.93174e-04 or h0 < -3.287828e-04 then + print + print "Crash !!!!!!!!!!!!!!!!" + print "Your impact created a crater " + abs(h) + " " + ms + " deep." + x1 = sqr(d1*d1+h1*h1)*g3 + print "At contact you were traveling " + x1 + " " + ns + "/hr" + else if abs(d)>10*z then + print "You are down safely - " + print + print "But missed the landing site by" + abs(d/g5) + " " + ns + "." + else + print + print "Tranquility Base here -- the Eagle has landed." + print "Congratulations -- there was no spacecraft damage." + print "You may now proceed with surface exploration." + end if + return false + end if + + if r0*a>164.474 then + print + print "You have been lost in space with no hope of recovery." + return false + end if + return true +end function + +startFirstGame +while true + t1 = 0; f = 0; p = 0 + integrate + while doOneTurn + end while + print + while true + qs = input("Do you want to try it again (yes/no)? ").lower + if qs and (qs[0] == "y" or qs[0] == "n") then break + end while + if qs[0] == "n" then + print + print "Too bad, the space program hates to lose experienced" + print "astronauts." + break + end if + startSubsequentGame +end while diff --git a/59_Lunar_LEM_Rocket/README.md b/59_Lunar_LEM_Rocket/README.md index 91fe1cd6..c0ec8df0 100644 --- a/59_Lunar_LEM_Rocket/README.md +++ b/59_Lunar_LEM_Rocket/README.md @@ -23,6 +23,15 @@ As published in Basic Computer Games (1978): Downloaded from Vintage Basic at http://www.vintage-basic.net/games.html +#### Known Bugs + +### lem.bas + +- The input validation on the thrust value (displayed as P, stored internally as F) appears to be incorrect. It allows negative values up up to -95, but at -96 or more balks and calls it negative. I suspect the intent was to disallow any value less than 0 (in keeping with the instructions), *or* nonzero values less than 10. + +- The physics calculations seem very sus. If you enter "1000,0,0" (i.e. no thrust at all, integrating 1000 seconds at a time) four times in a row, you first fall, but then mysteriously gain vertical speed, and end up being lost in space. This makes no sense. A similar result happened when just periodically applying 10% thrust in an attempt to hover. + + #### Porting Notes (please note any difficulties or challenges in porting here) From bc8156f7dadcb652946b100384c3370cffbf0d68 Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Tue, 12 Sep 2023 15:01:56 -0700 Subject: [PATCH 22/23] Added MiniScript implementation of lunar.bas. --- .../59_Lunar_LEM_Rocket/MiniScript/lunar.ms | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/lunar.ms diff --git a/00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/lunar.ms b/00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/lunar.ms new file mode 100644 index 00000000..e8da8d72 --- /dev/null +++ b/00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/lunar.ms @@ -0,0 +1,114 @@ +print " "*33 + "Lunar" +print " "*15 + "Creative Computing Morristown, New Jersey" +print; print; print +print "This is a computer simulation of an Apollo lunar" +print "landing capsule."; print; print +print "The on-board computer has failed (it was made by" +print "Xerox) so you have to land the capsule manually." + +printCols = function(fields, delimiter=null) + if delimiter == null then delimiter = text.delimiter + line = "" + for s in fields + line += (s + " "*12)[:12] + end for + print line, delimiter +end function + +doOneGame = function + print; print "Set burn rate of retro rockets to any value between" + print "0 (free fall) and 200 (maximum burn) pounds per second." + print "Set new burn rate every 10 seconds."; print + print "Capsule weight 32,500 lbs; fuel weight 16,500 lbs." + print; print; print; print "Good luck" + l = 0 + + print + printCols ["sec","mi + ft","mph","lb fuel","burn rate"] + print + a=120; v = 1; m=33000; n=16500; g=1e-03; z = 1.8 + + formulaSet1 = function // (subroutine 330) + outer.l += s + outer.t -= s + outer.m -= s * k + outer.a = i + outer.v = j + end function + + formulaSet2 = function // (subroutine 420) + outer.q = s * k / m + outer.j = v + g*s + z*(-q-q*q/2-q^3/3-q^4/4-q^5/5) + outer.i = a - g*s*s/2 - v*s+z*s*(q/2+q^2/6+q^3/12+q^4/20+q^5/30) + end function + + formulaSet3 = function // (loop 340-360) + while s >= 5e-3 + outer.d = v + sqrt(v * v + 2 * a * (g - z * k / m)) + outer.s = 2 * a / d + formulaSet2 + formulaSet1 + end while + end function + + while true + printCols [l, floor(a) + " " + floor(5280*(a-floor(a))), 3600*v, m-n], "" + k = input.val + t=10 + shouldExit = false + + while true + if m-n < 1e-03 then break + if t < 1e-03 then break + s = t; if m < n+s*k then s = (m-n)/k + formulaSet2 + if i <= 0 then + formulaSet3 + shouldExit = true + break + end if + if v > 0 and j < 0 then + while v > 0 and j <= 0 + w = (1 - m*g/(z*k))/2 + s = m*v / (z*k*(w + sqrt(w*w + v/z))) + 0.05 + formulaSet2 + if i <= 0 then + formulaSet3 + shouldExit = true + break + end if + formulaSet1 + end while + if shouldExit then break + continue + end if + formulaSet1 + end while + if shouldExit then break + if m-n < 1e-03 then + print "Fuel out at " + round(l) + " seconds" + s = (-v+sqrt(v*v+2*a*g))/g + v = v+g*s; l = l+s + break + end if + end while + + w = 3600*v + print "On moon at " + l + " seconds - impact velocity " + round(w,1) + " mph" + if w <= 1.2 then + print "Perfect landing!" + else if w <= 10 then + print "Good landing (could be better)" + else if w <= 60 then + print "Craft damage... you're stranded here until a rescue" + print "party arrives. Hope you have enough oxygen!" + else + print "Sorry there were no survivors. You blew it!" + print "In fact, you blasted a new lunar crater " + round(w*.227,1) + " feet deep!" + end if +end function + +while true + doOneGame + print; print; print; print "Try again??" +end while From bbac41f6bdd011f1ab5a0c29a75519795c99310d Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Tue, 12 Sep 2023 15:47:24 -0700 Subject: [PATCH 23/23] Added MiniScript version of rocket.bas. --- .../59_Lunar_LEM_Rocket/MiniScript/rocket.ms | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/rocket.ms diff --git a/00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/rocket.ms b/00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/rocket.ms new file mode 100644 index 00000000..3bb4957f --- /dev/null +++ b/00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/rocket.ms @@ -0,0 +1,101 @@ +if version.hostName == "Mini Micro" then clear +print " "*30 + "Rocket" +print " "*15 + "Creative Computing Morristown, New Jersey" +print; print; print +print "Lunar Landing Simulation" +print "----- ------- ----------"; print +yn = input("Do you want instructions (yes or no)? ").lower +if not yn or yn[0] != "n" then + print + print "You are landing on the moon and and have taken over manual" + print "control 1000 feet above a good landing spot. You have a down-" + print "ward velocity of 50 feet/sec. 150 units of fuel remain." + print + print "Here are the rules that govern your Apollo space-craft" + print "(Press Return after each one):"; print + print "(1) After each second the height, velocity, and remaining fuel" + print " will be reported via Digby your on-board computer." + input + print "(2) After the report a '?' will appear. Enter the number" + print " of units of fuel you wish to burn during the next" + print " second. Each unit of fuel will slow your descent by" + print " 1 foot/sec." + input + print "(3) The maximum thrust of your engine is 30 feet/sec/sec" + print " or 30 units of fuel per second." + input + print "(4) When you contact the lunar surface, your descent engine" + print " will automatically shut down and you will be given a" + print " report of your landing speed and remaining fuel." + input + print "(5) If you run out of fuel the '?' will no longer appear" + print " but your second by second report will continue until" + print " you contact the lunar surface."; print + input +end if + +pad = function(s, width=10) + return (s + " "*width)[:width] +end function + +// Bonus little feature when running in Mini Micro: display a header bar +// always at the top of the screen. +drawHeaders = function + display(2).mode = displayMode.text; td = display(2) + td.color = text.color; td.backColor = color.black + td.row = 25; td.column = 0 + td.print "sec feet speed fuel plot of distance" + " "*21 +end function + +while true + print "Beginning landing procedure.........."; print + print "G O O D L U C K ! ! !" + print; print + print "sec feet speed fuel plot of distance" + drawHeaders + print + t=0; h=1000; v=50; fuel=150 + while true + print pad(t,5) + pad(h,7) + pad(v, 10) + pad(fuel,8) + "|" + " "*floor(h/30) + "*" + if fuel <= 0 then + burn = 0 + wait 0.5 // (slight pause for drama and legibility) + else + burn = input("?").val + if burn < 0 then burn = 0 + if burn > 30 then burn=30 + if burn > fuel then + burn = fuel + print "**** out of fuel ****" + end if + end if + v1 = v - burn + 5 + fuel -= burn + h -= .5*(v+v1) + if h <= 0 then break + t += 1 + v = v1 + end while + print "***** CONTACT *****" + h = h+ .5*(v1+v) + if burn == 5 then + d = h/v + else + d = (-v+sqrt(v*v+h*(10-2*burn)))/(5-burn) + end if + v1 = v + (5-burn)*d + print "Touchdown at " + (t+d) + " seconds." + print "Landing velocity = " + round(v1,1) + " feet/sec." + print fuel + " units of fuel remaining." + if v1 == 0 then + print "Congratulations! a perfect landing!!" + print "Your license will be renewed.......later." + else if abs(v1) >= 2 then + print "***** Sorry, but you blew it!!!!" + print "Appropriate condolences will be sent to your next of kin." + end if + print; print; print + yn = input("Another mission? ").lower + if not yn or yn[0] != "y" then break +end while +print; print "Control out."; print