random

- collection of un-sorted bollocks
git clone git://git.acid.vegas/random.git
Log | Files | Refs | Archive

phish.py (1711B)

      1 #!/usr/bin/env python
      2 # phish - developed by acidvegas in python (https://git.acid.vegas/random)
      3 
      4 '''
      5 This is just a Python fork of https://git.supernets.org/hgw/phishies)
      6 
      7 This project was inspired entirely by https://botsin.space/@EmojiAquarium, source code found at https://gitlab.com/JoeSondow/fishies
      8 '''
      9 
     10 import random
     11 
     12 fish_types = ['🐟', '🐡', '🐠']
     13 rare_swimmer_types = ['🐙', '🐬', '🦑', '🦈']
     14 plant_types = ['🌱', '🌾', '🌿']
     15 rare_bottom_dwellers = ['🪨', '🐌', '🏰', '🦀', '🐚', '⚓️', '☘️']
     16 exceedingly_rare_junk = ['🎱', '🎲', '🎮', '🗿', '🔱', '🎷', '🗽', '💎', '💰', '🔔', '💀', '💩']
     17 
     18 def aquarium(height=5, width=10):
     19 	aquarium_array = []
     20 	for i in range(height):
     21 		line_arr = []
     22 		if i != height - 1:
     23 			# Ensure at least 2 fish
     24 			fish_positions = random.sample(range(width), 2)
     25 			for j in range(width):
     26 				rand_num = random.random() * 100
     27 				if j in fish_positions:
     28 					line_arr.append(random.choice(fish_types))
     29 				elif rand_num < 2:
     30 					line_arr.append(random.choice(rare_swimmer_types))
     31 				else:
     32 					line_arr.append(' ')
     33 		if i == height - 1:
     34 			# Ensure at least 2 plant types
     35 			plant_positions = random.sample(range(width), 2)
     36 			for j in range(width):
     37 				rand_num = random.random() * 100
     38 				if j in plant_positions:
     39 					line_arr.append(random.choice(plant_types))
     40 				elif rand_num < 2:
     41 					line_arr.append(random.choice(rare_bottom_dwellers))
     42 				elif rand_num < 0.5:
     43 					line_arr.append(random.choice(exceedingly_rare_junk))
     44 				else:
     45 					line_arr.append(' ')
     46 		aquarium_array.append(''.join(line_arr))
     47 	return aquarium_array
     48 
     49 if __name__ == '__main__':
     50 	while True:
     51 		for i in aquarium():
     52 			print(i)