Tuesday, January 8, 2013

Diner Dash 2: Pseudocode Level 50




procedure level_50
Table1=4, Table2=2, Table3=2, Table4=2, Table5=2, Table6=2, Table7=4, (Table[A]>=MAX) MAX=8 [A]
while customer wait
    do stand on the podium

//customer1
if Table1
    else if Table7
        then family sit here
    else kindly_senior==4
    else business_woman==4
if Table3
    else if Table5
    else if Table6
        then young_lady sit here
        else bookworm==2
if Table2
    then cellphone_addict sit here
if Table4
    then jogger sit here
if Table1==family&&Table7==kindly_senior
    then (Table[A]>=MAX) MAX=8 [A]==kindly_senior

//baby
if baby
    then give highchair

//dessert
if customer ask for dessert
    then give dessert

//snack
if customer ask for snack
    then give snack

//serving
take_order (menu, ticket_station: String)
    while menu
        do take it and drop to ticket station
serve_food (food_number, table_number: String)
    if table_number==food_number
        then serve food
give_check (finish, check: string)
    if customer finish eating
        then give check and pay tip
clear_dish (check, clear: string)
    if after pay
        then clear the dish

       
//customer2
if Table1
    else if Table7
        then family sit here
        else family==4
if Table2
    then cellphone_addict sit here
if Table3
    else if Table5
    else if Table6
        then bookworm sit here
        else kindly_senior==2
        else kindly_senior==2
if (Table[A]>=MAX) MAX=8 [A]
    then bookworm==3
    else business_woman==4

//baby
if baby
    then give highchair
   
//dessert
if customer ask for dessert
    then give dessert

//snack
if customer ask for snack
    then give snack

//serving
take_order (menu, ticket_station: String)
    while menu
        do take it and drop to ticket station
serve_food (food_number, table_number: String)
    if table_number==food_number
        then serve food
give_check (finish, check: string)
    if customer finish eating
        then give check and pay tip
clear_dish (check, clear: string)
    if after pay
        then clear the dish
       
       
//phone
if need help
    then call for podium_attending

//customer3
if Table1
    then family sit here
if Table2
    then cellphone_addict sit here
if Table3
    then kindly_senior sit here
if Table4
    then jogger sit here
if Table7
    then business_woman sit here
if (Table[A]>=MAX) MAX=8 [A]
    then business_woman sit here
    else bookworm==3

//baby
if baby
    then give highchair
   
//dessert
if customer ask for dessert
    then give dessert
   
//snack
if customer ask for snack
    then give snack

//serving
take_order (menu, ticket_station: String)
    while menu
        do take it and drop to ticket station
serve_food (food_number, table_number: String)
    if table_number==food_number
        then serve food
give_check (finish, check: string)
    if customer finish eating
        then give check and pay tip
clear_dish (check, clear: string)
    if after pay
        then clear the dish

       
//customer4
if Table1
    then family sit here
if Table2
    then cellphone_addict sit here
if Table4
    then jogger sit here
if Table5
    else if Table6
        then young lady sit here
        else business_woman==2
if Table7
    then kindly_senior sit here
    else young_lady==4
if (Table[A]>=MAX) MAX=8 [A]
    then kindly_senior sit here
    else young_lady or kindly_senior==4

//dessert
if customer ask for dessert
    then give dessert

//snack
if customer ask for snack
    then give snack

//serving
take_order (menu, ticket_station: String)
    while menu
        do take it and drop to ticket station
serve_food (food_number, table_number: String)
    if table_number==food_number
        then serve food
give_check (finish, check: string)
    if customer finish eating
        then give check and pay tip
clear_dish (check, clear: string)
    if after pay
        then clear the dish

0 comments:

Post a Comment