Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #A magic The Gathering Life Counter
- function getPlayers() {
- read -p "How many players are there?" PLAYERS
- case $PLAYERS in
- 2)
- select2PlayerFormat;
- ;;
- 3)
- select3PlayerFormat;
- ;;
- 4)
- select4PlayerFormat;
- ;;
- 5)
- select5PlayerFormat;
- ;;
- 6)
- select6PlayerFormat;
- ;;
- *)
- NotYetImplementedException;
- ;;
- esac
- }
- select2PlayerFormat() {
- local p1;
- local p2;
- local format;
- read -p "Enter Player 1's Name" $p1
- read -p "Enter player 2's Name" $p2
- select $format in 'EDH' 'STD';do
- case $format in
- 1)
- play2PlayerEDH $p1 $p2;
- ;;
- 2)
- play2PlayerSTD $p1 $p2
- ;;
- *)
- NotAValidFormat $PLAYERS;
- ;;
- esac
- done
- }
- select3PlayerFormat() {
- local p1;
- local p2;
- local p3;
- local format;
- read -p "Enter player 1's Name" $p1;
- read -p "Enter player 2's Name" $p2;
- read -p "Enter player 3's Name" $p3;
- select $format in 'EDH' 'STD'; do
- case $format in
- 1)
- play3PlayerEDH $p1 $p2 $p3;
- ;;
- 2)
- play3PlayerSTD $p1 $p2 $p3;
- ;;
- *)
- NotAValidFormat $PLAYERS;
- ;;
- esac
- done
- }
- select4PlayerFormat() {
- local p1;
- local p2;
- local p3;
- local p4;
- local format;
- read -p "Enter player 1's name" $p1;
- read -p "Enter player 2's name" $p2;
- read -p "Enter player 3's name" $p3;
- read -p "Enter player 4's name" $p4;
- select $format in 'EDH' 'STD' '2HG' '2v2' ;do
- case $format in
- 1)
- play4playerEDH $p1 $p2 $p3 $p4;
- ;;
- 2)
- play4PlayerSTD $p1 $p2 $p3 $p4;
- ;;
- 3)
- play2HG $p1 $p2 $p3 $p4;
- ;;
- 4)
- play2v2 $p1 $p2 $p3 $p4;
- ;;
- *)
- NotAValidFormat $PLAYERS;
- ;;
- esac
- done
- }
- select5PlayerFormat() {
- local p1;
- local p2;
- local p3;
- local p4;
- local p5;
- local format;
- read -p "Enter Player 1's Name" $p1;
- read -p "Enter Player 2's Name" $p2;
- read -p "Enter Player 3's Name" $p3;
- read -p "Enter player 4's Name" $p4;
- read -p "Enter player 5's Name" $p5
- select $format in 'EDH' 'STD';do
- case $format in
- 1)
- play5PlayerEDH $p1 $p2 $p3 $p4 $p5;
- ;;
- 2)
- play5PlayerSTD $p1 $p2 $p3 $p4 $p5;
- ;;
- *)
- NotAValidFormat $PLAYERS;
- ;;
- esac
- done
- }
- select6PlayerFormat() {
- local p1;
- local p2;
- local p3;
- local p4;
- local p5;
- local p6;
- local format;
- read -p "Enter Player 1's Name" $p1;
- read -p "Enter player 2's name" $p2;
- read -p "Enter player 3's name" $p3;
- read -p "Enter player 4's name" $p4;
- read -p "Enter player 5's name" $p5;
- read -p "Enter player 6's name" $p6;
- select $format in 'EDH' 'STD' '3HG' '3v3' 'Emperor';do
- case $format in
- 1)
- play6PlayerEDH $p1 $p2 $p3 $p4 $p5 $p6;
- ;;
- 2)
- play6PlayerSTD $p1 $p2 $p3 $p4 $p5 $p6;
- ;;
- 3)
- play3HG $p1 $p2 $p3 $p4 $p5 $p6;
- ;;
- 4)
- play3v3 $p1 $p2 $p3 $p4 $p5 $p6;
- ;;
- *)
- NotAValidFormat $PLAYERS;
- ;;
- esac
- done
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement