File size: 2,228 Bytes
4632fbc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import streamlit as st
import random
import pandas as pd

# Cascadia Game Components
habitat_tiles = ['🌲', '🏞️', '🌊', '🌡', 'πŸŒ„']  # Representing different habitats
wildlife_tokens = ['🐻', 'πŸ¦…', '🐟', '🦌', '🐿️']  # Different wildlife
nature_tokens = 'πŸƒ'  # Nature tokens

# Initialize game state
if 'habitat_stack' not in st.session_state:
    st.session_state['habitat_stack'] = random.sample(habitat_tiles * 10, 50)
if 'wildlife_stack' not in st.session_state:
    st.session_state['wildlife_stack'] = random.sample(wildlife_tokens * 10, 50)
if 'player_area' not in st.session_state:
    st.session_state['player_area'] = {'habitat': [], 'wildlife': []}
if 'nature_tokens' not in st.session_state:
    st.session_state['nature_tokens'] = 0

# Function to draw habitat and wildlife
def draw_habitat_and_wildlife():
    if st.session_state.habitat_stack and st.session_state.wildlife_stack:
        habitat = st.session_state.habitat_stack.pop()
        wildlife = st.session_state.wildlife_stack.pop()
        return habitat, wildlife
    else:
        return None, None

# Display game board
st.title("🌲 Cascadia Lite 🌲")
st.write("## Your Play Area")
col1, col2 = st.columns(2)
with col1:
    st.write("Habitat Tiles")
    st.write(' '.join(st.session_state.player_area['habitat']))
with col2:
    st.write("Wildlife Tokens")
    st.write(' '.join(st.session_state.player_area['wildlife']))

# Drafting phase
st.write("## Drafting Phase")
if st.button("Draw Habitat and Wildlife"):
    habitat, wildlife = draw_habitat_and_wildlife()
    if habitat and wildlife:
        st.session_state.player_area['habitat'].append(habitat)
        st.session_state.player_area['wildlife'].append(wildlife)
        st.write(f"Drawn Habitat: {habitat}, Wildlife: {wildlife}")
    else:
        st.write("No more tiles or tokens to draw!")

# Scoring (Placeholder for actual scoring logic)
st.write("## Scoring")
st.write("Your score will be calculated here.")

# End of Game (Placeholder)
st.write("## End of Game")
st.write("Final score and winner announcement will be displayed here.")

# Run the Streamlit app
st.write("## Game Controls")
st.write("Use the buttons and controls to play the game!")