awacke1 commited on
Commit
668cb89
Β·
verified Β·
1 Parent(s): e604411

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -41
app.py DELETED
@@ -1,41 +0,0 @@
1
- import streamlit as st
2
- import numpy as np
3
- import random
4
-
5
- # Expanded set of emojis for landscape elements
6
- emojis = ["🌳", "πŸƒ", "πŸ„", "🌲", "🌿", "🏠", "🏰", "πŸ—Ό", "πŸ›€οΈ", "🌊", "🏞️", "🌁", "🌾", "🏜️", "🏝️", "πŸ›–", "πŸ›€οΈ", "πŸ›£οΈ", "πŸ•οΈ", "πŸŒ‹", "⛰️", "🚢", "🧱", "🌡", "🍁", "🌼", "🌻", "🌺", "🏑", "πŸ—ΊοΈ"]
7
-
8
- def initialize_emoji_map(size):
9
- """Initialize an emoji map with diverse landscape elements."""
10
- return np.random.choice(emojis, (size, size))
11
-
12
- def display_emoji_map(emoji_map):
13
- """Convert the emoji map to a string for display."""
14
- map_str = "\n".join(["".join(row) for row in emoji_map])
15
- st.text(map_str)
16
-
17
- def move_emojis(emoji_map, direction):
18
- """Shift emojis in the specified direction with wrap-around."""
19
- if direction == "North":
20
- emoji_map = np.roll(emoji_map, 1, axis=0)
21
- elif direction == "South":
22
- emoji_map = np.roll(emoji_map, -1, axis=0)
23
- elif direction == "West":
24
- emoji_map = np.roll(emoji_map, 1, axis=1)
25
- elif direction == "East":
26
- emoji_map = np.roll(emoji_map, -1, axis=1)
27
- return emoji_map
28
-
29
- def main():
30
- st.title("Emoji Landscape Exploration")
31
- size = st.slider("Grid Size", 5, 40, 40)
32
- if 'emoji_map' not in st.session_state:
33
- st.session_state.emoji_map = initialize_emoji_map(size)
34
- display_emoji_map(st.session_state.emoji_map)
35
- direction = st.selectbox("Move direction", ["North", "South", "East", "West"])
36
- if st.button("Move"):
37
- st.session_state.emoji_map = move_emojis(st.session_state.emoji_map, direction)
38
- st.experimental_rerun()
39
-
40
- if __name__ == "__main__":
41
- main()