Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language F3

Date:07/25/09
Author:Bryan Knowles
URL:http://blogs.sun.com/chrisoliver/resource/f3.html
Comments:0
Info:http://blogs.sun.com/chrisoliver/resource/f3.html
Score: (2.92 in 12 votes)
package sixpack;
import f3.ui.*;
import java.lang.System;

var lyrics = [];
for (count in [99..0]){
  var line = "";
  if (count == 0){
    line = "No bottles of beer on the wall, No bottles of beer.\nTake none down, pass none
around.\nNo bottles of beer on the wall.";
  } else if (count == 1){
    line = "One bottle of beer on the wall, One bottles of beer.\nTake it down, pass it around.\nOne
bottle of beer on the wall.";
  } else{
    line = "{count} bottles of beer on the wall, {count} bottles of beer.\nTake one down, pass it
around.\n{count} bottles of beer on the wall.";
  }
  insert line into lyrics;
}

Frame {
  visible: true
  title: "99 Bottles of Beer"
  width: 720
  height: 100
  onClose: operation(){
    System.exit(0);
  }
  content:
    SimpleLabel {
      text: bind lyrics[[0..100] dur 5000 linear]
    }
}

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
foreach loop versionBryan Knowles08/29/090

Comments

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: