/****************************************************************************** * This program prints the lyrics to the song "Bingo" * * Copyright © 2020 Richard Lesh. All rights reserved. *****************************************************************************/ import org.pureprogrammer.Utils; public class BingoLyrics { static final String NAME = "BINGO"; static final String HANDS_CLAPPING = "\ud83d\udc4f"; static void printVerse(int num) { System.out.println("There was a farmer who had a dog,"); System.out.println(Utils.join("", "and ", NAME, " was his name-o.")); for (int j = 0; j < 3; ++j) { for (int i = 0; i < Utils.cpLength(NAME); ++i) { if (i > 0) { System.out.print("-"); } if (i <= num - 1) { System.out.print(HANDS_CLAPPING); } else { System.out.print(Utils.uniAt(NAME, i)); } } System.out.println(); } System.out.println(Utils.join("", "and ", NAME, " was his name-o.")); System.out.println(); } public static void main(String[] args) { for (int i = 0; i <= Utils.cpLength(NAME); ++i) { printVerse(i); } } }