Skip to content

Instantly share code, notes, and snippets.

@avielg
Forked from RoySegall/gist:9995115
Last active August 29, 2015 13:58
Show Gist options
  • Save avielg/9995351 to your computer and use it in GitHub Desktop.
Save avielg/9995351 to your computer and use it in GitHub Desktop.
public class singHadGadiaSong {
public static void singHadGadia(String[] characters, String[] actions, int n)
{
if (n >= characters.length)
return;
System.out.println("ואתא " + characters[n]);
for (int i = n - 1; i >= 0; i--) {
String prefix = (i == n - 1 ? "ו" : "ד");
System.out.println(prefix + actions[i] + " ל" + characters[i]);
}
String had = ", חד גדיא";
System.out.println("דזבין אבא בתרי זוזי" + had + had + ".");
printUnderline(30);
singHadGadia(characters, actions, n + 1);
}
public static void printUnderline(int dashes)
{
for (int i = 0; i <= dashes; i++ {
System.out.print("-");
}
System.out.println();
}
public static void main(String[] args)
{
String[] characters = { "גדיא", "שונרא", "כלבא", "חוטרא", "נורא", "מיא",
"תורא", "שוחט", "מלאך-המוות", "הקבה" };
String[] actions = {"אכלא", "נשך", "הכה", "שרף", "כבה", "שתה", "שחט", "שחט", "שחט"};
System.out.println("חד גדיא, חד גדיא");
printUnderline(30);
singHadGadia(characters, actions, 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment