Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create the Program Graph for the play() method given above. Create the DD-Path Graph for the play() method given above. Make sure you include the
Create the Program Graph for the play() method given above.
Create the DD-Path Graph for the play() method given above.
Make sure you include the table translating from Program Graph nodes (from your graph above), with the corresponding DD-Path node labeled with a letter.
public void play() { 2. String src = null; 3. String dest = null; 4. LinkedList srcPile = null; 5. boolean gameOver = false; 6. 7. while (!gameOver) { 8. displayTableau(); 9. 10. do { 11. System.out.print(" Move top card from (D, W0, W1, W2, W3, or Q to quit): "); 12 . src = in.nextLine(); 13. if (src.toUpperCase().charAt(0) == 'Q') { 14. gameOver = true; 15. } 16. } while (!gameOver && (srcPile = getSrcPile(src)) == null); 17. 18. if (!gameOver) { 19. System.out.print(" to (F0, F1, F2, F3, W0, W1, W2, W3): "); 20. dest = in.nextLine(); 21. addToDestPile(dest, srcPile); 22. } 23. 24. gameOver = checkForGameOver(gameOver); 26. } 27. }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started