Editing Cave of the Nadir (Guide)/Script
From Fallen London Wiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
<code> | <code> | ||
− | + | -*- coding: utf-8 -*- | |
− | + | """ | |
− | + | Created on Mon May 1 09:05:19 2023 | |
− | + | ||
− | + | @author: Gyro | |
− | + | """ | |
− | + | ||
− | + | import random | |
− | + | ||
− | + | ||
− | + | def drawCard(deck): | |
newCardName = random.choice(list(deck.keys())) | newCardName = random.choice(list(deck.keys())) | ||
newCard = deck.pop(newCardName) | newCard = deck.pop(newCardName) | ||
return [newCardName] + newCard | return [newCardName] + newCard | ||
− | + | ||
− | + | def playCard(deck, cardNumber,currentHand, echoes, Irrigo): | |
playedCard = currentHand.pop(cardNumber) | playedCard = currentHand.pop(cardNumber) | ||
deck[playedCard[0]] = playedCard[1:3] | deck[playedCard[0]] = playedCard[1:3] | ||
Line 23: | Line 23: | ||
return [echoes, Irrigo] | return [echoes, Irrigo] | ||
− | + | ||
− | + | def caveTrip(): | |
Cards = { | Cards = { | ||
"Cardgame": [.6,1], | "Cardgame": [.6,1], | ||
Line 47: | Line 47: | ||
"woods": [36.5,2] | "woods": [36.5,2] | ||
} | } | ||
− | + | ||
− | + | ||
Nightmares = 6 | Nightmares = 6 | ||
− | + | ||
if Nightmares < 6: | if Nightmares < 6: | ||
Cards.pop("Dream6") | Cards.pop("Dream6") | ||
Line 78: | Line 78: | ||
actions += 1 | actions += 1 | ||
epa = echoes/actions | epa = echoes/actions | ||
− | return epa | + | return epa |
− | + | ||
− | + | sample = [] | |
− | + | for i in range(1000000): | |
sample += [caveTrip()] | sample += [caveTrip()] | ||
− | |||
</code> | </code> |