Giter VIP home page Giter VIP logo

rubegoldbash's Introduction

______         _            _____         _      _                           
| ___ \       | |          |  __ \       | |    | |    ____             __   
| |_/ / _   _ | |__    ___ | |  \/  ___  | |  __| |   / __ )____ ______/ /_  
|    / | | | ||  _ \  / _ \| | __  / _ \ | | / _  |  / __  / __ // ___/ __ \ 
| |\ \ | |_| || |_) ||  __/| |_\ \| (_) || || (_| | / /_/ / /_/ (__  ) / / / 
\_| \_| \____||____/  \___| \____/ \___/ |_| \____//_____/\____/____/_/ /_/  
(っ◕‿◕)っ is an awesome game!

A command-line quest where your goal is to invent Rube Goldberg machines in bash! Create the longest one-liners you can, the more pipes (|) the better. Master Rube ((◕‿◕) Hi there!) will help you during your quest.

Getting Started

First open your favorite prompt, and then:

bash
source <(curl -sL start.rubegoldbash.com)

# Use share to submit your score:
rubeshare
# Use exit to stop RubeGoldBash
exit

The game relies on bash and curl to work, as well as other bash builtins and standard UNIX tools.

Look, screenshot!

Screenshot

Built with

Online services

Command line

Related

Main concept

Games

Videos

Contributing

Examples of RubeGoldBash (SPOILERS!)

# Retrieve the weather for your location
curl -s ip.appspot.com | xargs -n 1 curl -s "freegeoip.net/csv/$1" | cut -d ',' -f '9 10' | sed 's/,/\&lon=/g' | xargs -n 1 echo "http://api.openweathermap.org/data/2.5/weather?mode=html&lat=$1" | sed 's/ //g' | xargs -n 1 curl -s $1 | tee weather.html
# Same request, with display to the prompt using lynx
curl -s ip.appspot.com | xargs -n 1 curl -s "freegeoip.net/csv/$1" | cut -d ',' -f '9 10' | sed 's/,/\&lon=/g' | xargs -n 1 echo "http://api.openweathermap.org/data/2.5/weather?mode=html&lat=$1" | sed 's/ //g' | xargs -n 1 curl -s $1 | lynx -stdin -dump

# Retrieve the answer to "When will it be done?" (scraping) and make a nice voice read it for you.
lynx --dump whenwillitbedone.trgdy.com | head -n 8 | tail -n 4 | tr "\\n" ' ' | cut -d '[' -f 1 | sed 's/   //g' | sed "s/'/ /g" | perl -pe 's/([^a-zA-Z0-9_.!~*()'\''-])/sprintf("%%%02X", ord($1))/ge' | xargs -n 1 echo "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=$1" | sed 's/ //g' | xargs -n 1 curl -s "$1" > whenwillitbedone.mp3
# File can be read with
afplay whenwillitbedone.mp3

# Count the number of folders in the current working directory.
ls -l | cut -c 1 | grep d | wc -l

# Find the longest name
cat /usr/share/dict/propernames | grep 'S' | awk '{print length($1), $1}' | sort -n | tail -n 1 | cut -d ' ' -f 2
# And spell it
cat /usr/share/dict/propernames | grep 'S' | awk '{print length($1), $1}' | sort -n | tail -n 1 | cut -d ' ' -f 2 | say

Related commands to play with

# DNS IP lookup
dig +short myip.opendns.com @resolver1.opendns.com

# WS IP lookup
curl ip.appspot.com
curl ifconfig.me/ip
curl ipinfo.io/ip

# WS location lookup
curl freegeoip.net/csv/116.193.147.34
curl ipinfo.io/geo

# Current weather (it wouldn't be Rube Goldberg-y if it was useful)
curl "http://api.openweathermap.org/data/2.5/weather?lat=-41.00&lon=174.00&mode=html"

# Sound
curl "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world" > test.mp3
afplay test.mp3

# Dict
curl dict://dict.org/d:test

# Scraping
curl whenwillitbedone.trgdy.com | grep '<p>'

## Cal
cal | sed "s/.*/ & /;s/ $(date +%d) / [] /"
cal | sed "s/.*/ & /;s/ $(date +%d) / $(printf '\e[0;31m[]\e[0m') /"

## Cool one-liners
perl -le '$l=80;$l2="!" x $l;substr+($l2^=$l2),$l/2,1,"\xFF";{local $_=$l2;y/\0\xFF/ ^/;print;($lf,$rt)=map{substr $l2 x 2,$_%$l,$l;}1,-1;$l2=$lf^$rt;select undef,undef,undef,.1;redo}'
echo -e "\e[32m"; while :; do for i in {1..16}; do r="$(($RANDOM % 2))"; if [[ $(($RANDOM % 5)) == 1 ]]; then if [[ $(($RANDOM % 4)) == 1 ]]; then v+="\e[1m $r   "; else v+="\e[2m $r   "; fi; else v+="     "; fi; done; echo -e "$v"; v=""; done
yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done

## Building blocks to use
last
cat /dev/urandom | hexdump -C | grep "ca fe"
cat /usr/share/dict/propernames
cat /usr/share/dict/connectives
whatis

rubegoldbash's People

Contributors

thibaudcolas avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nanshenhao1

rubegoldbash's Issues

Zsh support

  • history management
  • PS1 & PS2 syntax
  • score_game:local:13: not an identifier: 1
  • replace PROMPT_COMMAND

Roadmap

Intent:

  • Build a quest playable on any UNIX command prompt
  • Make people learn commands
  • Make people combine commands
  • People's quests can be replayed
  • People's quests can be saved
  • People upload their score online for everyone to see
  • People can fork other people's games
  • The most awesome commands stand out

Tasks:

  • Instructions on how to open a prompt —Current version of the game requires basic command line knowledge.
  • Explain what bash is, what piping means
  • JSON serialize history
  • Support other shells — Too time-consuming, bash is readily available anywhere anyway.
  • Support colorless terminals
  • Test on Cygwin
  • Test on Ubuntu
  • Record gameplay footage (properly)
  • Add "start playing" command to website
  • Add cool commands somewhere

Postponed:

  • Sounds
  • Load other people's gists
  • Tweet high scores
  • Anti tamper

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.