Skip to content

Instantly share code, notes, and snippets.

@RoySegall
Last active August 29, 2015 13:58
Show Gist options
  • Save RoySegall/9995115 to your computer and use it in GitHub Desktop.
Save RoySegall/9995115 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]);
}
System.out.println("דזבין אבא בתרי זוזי, חד גדיא, חד גדיא.");
System.out.println("----------------------------");
singHadGadia(characters, actions, n + 1);
}
public static void main(String[] args)
{
String[] characters = { "גדיא", "שונרא", "כלבא", "חוטרא", "נורא", "מיא",
"תורא", "שוחט", "מלאך-המוות", "הקבה" };
String[] actions = {"אכלא", "נשך", "הכה", "שרף", "כבה", "שתה", "שחט", "שחט", "שחט"};
System.out.println("חד גדיא, חד גדיא");
System.out.println("----------------------------");
singHadGadia(characters, actions, 1);
}
}
@avielg
Copy link

avielg commented Apr 5, 2014

מי מדפיס ״חד גדיא, חג גדיא״?! לא כותבים קוד פעמיים!
כנ״ל לגבי ההדפסה של המקפים....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment