Last active
August 29, 2015 13:58
-
-
Save RoySegall/9995115 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
מי מדפיס ״חד גדיא, חג גדיא״?! לא כותבים קוד פעמיים!
כנ״ל לגבי ההדפסה של המקפים....