Absurd Minds

More than 100 years without a motto.
It is currently 28 Mar 2024 07:47

All times are UTC-04:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: mario.sh
PostPosted: 05 Sep 2016 15:54 
Offline
User avatar

Joined: 24 Feb 2015 09:39
Posts: 1081
I got bored.
Code:
#!/bin/bash
 
MELODY=(2637 2637 0 2637 0 2093 2637 0 3136 0 0  0 1568 0 0 0 2093 0 0 1568 0 0 1319 0 0 1760 0 1976 0 1865 1760 0 1568 2637 3136 3520 0 2794 3136 0 2637 0 2093 2349 1976 0 0 2093 0 0 1568 0 0 1319 0 0 1760 0 1976 0 1865 1760 0 1568 2637 3136 3520 0 2794 3136 0 2637 0 2093 2349 1976 0 0)
TEMPO=(12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 9 9 9 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 9 9 9 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12)
 
COUNT=0
while [ $COUNT -lt 78 ]
do
  TONE=${MELODY[COUNT]}
  COUNT=$((COUNT+1))
  LENGTH=$((10 * ${TEMPO[COUNT]}))
  SLEEP=`echo "scale=3 ; $LENGTH / 1000" | bc`
  if [ "$TONE" == "0" ]; then
    sleep $SLEEP
    echo "sleep $SLEEP"
  else
    beep -f $TONE -l $LENGTH
    echo "beep -f $TONE -l $LENGTH"
  fi
done
https://www.youtube.com/watch?v=KgH5tCOlKfo

_________________
Image


Top
   
 Post subject: Re: mario.sh
PostPosted: 06 Sep 2016 00:30 
Offline

Joined: 07 Apr 2010 04:01
Posts: 257
nice! i approve!

_________________
Image


Top
   
 Post subject: Re: mario.sh
PostPosted: 06 Sep 2016 06:44 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8392
That's hilarious.

_________________
Server list
Donate


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC-04:00


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited