diff --git a/screenless/bureau/soup/__init__.py b/screenless/bureau/soup/__init__.py new file mode 100644 index 0000000..db2ee1e --- /dev/null +++ b/screenless/bureau/soup/__init__.py @@ -0,0 +1,5 @@ +from . import soup + + +def main(): + soup.main() diff --git a/screenless/bureau/soup/onesentenceg.yml b/screenless/bureau/soup/onesentenceg.yml new file mode 100644 index 0000000..c0a47b2 --- /dev/null +++ b/screenless/bureau/soup/onesentenceg.yml @@ -0,0 +1,276 @@ +games: + - |- + You are in an empty + room with 13 doors + that are portals + to 13 different worlds. + - |- + 5 min + slow-motion epidemics, + visually transmitted. + - |- + Every crisis + is a simulation + of another crisis. + - |- + Every crisis + is a preparation + for another crisis. + - You receive a point for each floating tile you encounter on the street. + - |- + You sleep and + the more you sleep, + the more the buildings + around the bedroom + collapse and nature + starts growing and + invading the space. + - |- + ThermoSTATE + the state where no citizen feels cold. 🥵 + - The same day is looping over and over. The goal is to figure out which decision will make you move on to the next day. + - A flat with no floors. + - |- + Hello, + where are you, + what can you see + from there? + - You give someone a gift. They give the gift to someone else. + - "You meet a person in a corridor, but you're in a supermarket, in Canada." + - |- + Collect fantasy words + in a fantasy world + by talking to other fantasy characters + so you can describe fantasy objects better. + - |- + ...and yes... + only give + a positive answer + (or inflexion) + to any question. + - |- + A city room + without gravity. + - |- + Thank you! + No, I thank you! + Noo, I thank YOU! + No. I really thank you. + No, I THANK you! + - |- + You get up and you're + a dictator for 5 min. + - |- + You get up and you're + a dictator for 5 min + and if you don't change anything in the current status quo you die. + - You have a lethal laugh. + - |- + You are late. + You have to leave + but you start + playing a game. + - You change language and you discover how clever you are but you cannot communicate with others anymore. + - You are in an empty room with 13 doors that are portals to 13 similar worlds, only your character changes. + - |- + Plastic bag on a + windy day at the + market simulator. + - |- + Reality show + for cultural workers. + - A portal will take you to the exact opposite spot on the globe. + - You dive into an ocean without an ocean floor but it's actually the sky. + - |- + A bruschetta + and some tomato sauce, + but you're not in Italy. + - "You're a flock of birds. You interact with things only collectively." + - "You're in a layer of a multilayered world. You cannot see the effect of your actions unless you change the layer." + - |- + Any action + could potentially kill + the other players + (including staying still). + The longer all the players are kept alive the more you score. + - |- + Dutch wind + vs. + Human being + - |- + Interpret what birds + are saying. + - |- + A game where your + real-life issues are solved through playing and you don't realise + it's happening. + - |- + Sometimes things change depending + on who you tell. + - |- +                   🎈 + + + You are a helium balloon + and you just got + to the big city. + - |- + You are stuck in reality and you're trying to get back to your imaginary world but cannot + find the door. + - |- + Build the highest high + heels in the world so + you can traverse the + Mariana Trench, with a + depth of 11 034 m, + without touching + the water. + - |- + It's night with rain + and Devil Dutch Wind + (DDW) and you are + trying to ride your + way home. + - |- + The calories burned while running on the treadmill become + actual currency. + - |- + Files keep coming in + and you have to + sort them in your + folder system. + - |- + You get to experience your whole life + in reverse. + - |- + There is no gravity, + no left or right, + no up and down, + but you have to guide + someone to a treasure. + - |- + Life's a game, + play the game. + - "You're a door and you have the power to open or close as you wish. Sometimes someone tries to go through you, will you let them pass?" + - You enter a room full of obscure items and have to select some of them to curate an exhibition. + - |- + Time is given + to each player. + - |- + During the game, several tasks are given to players, and they need to split their time and accomplish those tasks in the time allocated. If you fail to do so, it will affect the whole time sequence. In short, you play + the game by splitting your + time, rearranging your + priority constantly. + - Git commit-push battle. + - |- + Noise-inducing + headphones so you + can hear the electronic + magnetic fields + around you. + - Harmonizing everything. + - |- + The printer that works + is hidden somewhere + in a maze. + - Do you want me to tell you the story of Wendy? + - |- + You enter a room + where you meet your + friends with whom + you play a game where + you play a game, where + you play a game, where + you play a game. + - |- + The rain starts + when the meeting stops. + - |- + The rain stops + when the meeting starts. + - Print 80000 post-its. + - Guess the Guests. + - |- + Try to eat the hole + of a donut. + - |- + Try to find out whether + the donut hole which + was expired was + any good. + - |- + Each chatroom is + a different reality. + - |- + A random age + generator that + gives you + a random age + on your birthday + and your body + turns that age. + - |- + A random ape + generator that + gives you + a random ape + on your birthday + and your body + turns that ape. + - |- + A random grape + generator that + gives you + a random grape + on your birthday + and your body + turns that wine. + - |- + A random wine + generator that + gives you + a random headache + on your birthday + and your body + turns that wine. + - |- + A random-random + generator that + gives you + a random-random + on your birthday + and your body + turns that random. + - |- + The world is literally turned upside down + and you must try + to cure a hickup! + - Randominance. + - |- + Steal Jeff Bezos's + money and use it + for the loot box. + - |- + Sushi but + it tastes + like cola. + - |- + Cola but + it tastes + like sushi. + - |- + Your manager reminds + you of Michael Scott + and you feel like you + are part of the Office. + - |- + Grocery. + Delivery. + Startup. + - A one-sentence games list that never ends... + - |- + Inspired by Pippin + Barr's Game Ideas 🛴 + www.pippinbarr.com + /category + /game-ideas diff --git a/screenless/bureau/soup/soup.py b/screenless/bureau/soup/soup.py new file mode 100644 index 0000000..267a004 --- /dev/null +++ b/screenless/bureau/soup/soup.py @@ -0,0 +1,98 @@ +import glob +import math +import mimetypes +import os +import subprocess +import urllib +import yaml +from random import choice + +from PIL import Image + +from bureau import Bureau, add_command, add_api + + +class Soup(Bureau): + """ + This bureau cooks few texts with xpub's python function recipes . + """ + + name = "Canteen of the Screenless Office" + prefix = "SB" + version = 0 + + def __init__(self): + Bureau.__init__(self) + + @add_command("1sentence", "1 Sentence Game Ideas") + def print_fortune(self): + """ + Prints one entry from the one sentence game ideas. + """ + with open('onesentenceg.yml', 'r') as f: + games = yaml.load(f) + game = choice(games['games']) + + self.print_small(game) + + @add_api("gif", "Moving Picture") + def print_gif(self, data): + """ + Prints out a series of image frames which can be viewed in lively + motion on any standard zoetrope. (Ø200mm) + """ + # download the video file + d_url = data["url"] + filename, headers = urllib.request.urlretrieve(d_url) + print("fetching", d_url, filename) + + # make sure we have a legit filename + ext = mimetypes.guess_extension(headers["Content-Type"]) + if not filename.endswith(ext): + os.rename(filename, filename + ext) + filename = filename + ext + print("renamed to ", filename) + + # if we have something that's a gif or webp (png?) then + # just print 12 frames + if filename.endswith(("gif", "webp")): + print("gif stuff") + img = Image.open(filename) + print(img.n_frames) + grab_frame = 0 + out_frame = 0 + in_len = float(img.n_frames) + # TODO: deal with frame counts lower than 12 + # and maybe a different algo that includes endpoints + for frame in range(img.n_frames): + img.seek(frame) + if grab_frame == frame: + img_rotated = img.rotate(90, expand=True) + self.print_small_image(img_rotated) + out_frame += 1 + grab_frame = math.ceil(out_frame * in_len / 12) + else: + # how many frames do we have? + cli = "ffprobe -i " + filename + \ + " -show_format -v quiet | sed -n 's/duration=//p'" + vid_len = str(subprocess.check_output(cli), encoding="UTF-8") + print("video len: " + vid_len) + # TODO: if vid_len is not a number handle this error + + # lengthen/shorten it to 12 frames + # dump frames to temp files + cli = "ffmpeg -i" + filename + " -vf fps=12/" + vid_len +\ + " thumb%02d.png" + + # print em out! + + self.print_small("") + + +def main(): + ha = Soup() + ha.run() + + +if __name__ == "__main__": + main()