-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUI.ctxt
43 lines (43 loc) · 4.34 KB
/
UI.ctxt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#BlueJ class context
comment0.target=UI
comment0.text=\r\n\ This\ class\ provides\ a\ text\ based\ user\ interface\ for\ the\ player\ to\ interact\ with\ the\ game\r\n\ It\ allows\ the\ user\ to\ make\ a\ move,\ save\ the\ game,\ load\ the\ game,\ undo\ a\ move,\ redo\ a\ move,\ clear\ the\ game\ and\ quit\ the\ game\r\n\ It\ also\ displays\ the\ game\ in\ the\ terminal\ for\ the\ user\ to\ play\r\n\ \r\n\ @author\ Lauren\ Scott\r\n\ @author\ Arun\ Kumar\ Sekar\r\n\ \r\n\ \r\n\ @version\ January\ 2024\r\n
comment1.params=
comment1.target=UI()
comment1.text=\r\n\ \r\n\ Default\ Constructor\ for\ the\ class\ UI\r\n\ Creates\ a\ new\ TEXT-UI\ instance\ of\ the\ Sudoku\ game\r\n\ Initializes\ the\ game\ variables\r\n\ \r\n
comment10.params=
comment10.target=void\ clearGame()
comment10.text=\r\n\ \r\n\ This\ method\ resets\ the\ current\ game\ to\ a\ new\ game\r\n\ It\ resets\ all\ the\ stacks\ \r\n\ \ \r\n
comment11.params=
comment11.target=void\ replayGame()
comment11.text=\r\n\ \r\n\ This\ method\ allows\ the\ user\ to\ replay\ the\ game\ once\ they\ have\ won\ \r\n\ Once\ the\ player\ wins\ and\ selects\ Y\ to\ replay\ the\ game,\ the\ game\ is\ reset\ and\ the\ user\ can\ play\ again\r\n\ If\ N\ is\ selected,\ the\ game\ ends\r\n\ \r\n
comment12.params=args
comment12.target=void\ main(java.lang.String[])
comment12.text=\r\n\ The\ main\ method\ within\ the\ Java\ application.\ \r\n\ It's\ the\ core\ method\ of\ the\ program\ and\ calls\ all\ others.\r\n
comment13.params=
comment13.target=void\ gameLoop()
comment13.text=\r\n\ It\ conducts\ the\ main\ loop\ of\ the\ game\r\n\ It\ runs\ the\ game\ until\ the\ user\ quits[Q]\ or\ wins\ and\ choose\ to\ replay\ the\ game[Y/N]\r\n\ \r\n
comment2.params=
comment2.target=void\ winningAnnouncement()
comment2.text=\r\n\ winningAnnouncement\r\n\ Method\ that\ outputs\ an\ announcement\ when\ the\ user\ has\ won\ the\ game\r\n
comment3.params=
comment3.target=void\ menu()
comment3.text=\r\n\ menu\r\n\ Method\ that\ displays\ the\ menu\ to\ the\ user\r\n
comment4.params=
comment4.target=void\ displayGame()
comment4.text=\r\n\ \r\n\ displayGame\r\n\ Method\ that\ displays\ the\ game\ for\ the\ user\ to\ play\r\n\ It\ displays\ the\ game\ in\ the\ terminal\r\n\ This\ method\ sets\ the\ game\ size\ to\ 9\ or\ 4\ depending\ on\ the\ level\r\n\ Also\ this\ method\ setup\ the\ game\ layout\ in\ the\ Text-UI\r\n\ \r\n
comment5.params=
comment5.target=java.lang.String\ getChoice()
comment5.text=\r\n\ Method\ that\ gets\ the\ user's\ choice\ from\ the\ menu\ and\ conducts\ the\ activities\r\n\ accordingly\r\n\ If\ invalid\ input\ is\ entered,\ the\ method\ will\ prompt\ the\ user\ to\ enter\ a\ valid\ input\r\n\ It\ calls\ the\ makeMake\ method\ from\ the\ Sudoku\ class\ to\ make\ a\ move\r\n\ \r\n\ \r\n\ @return\ the\ choice\ the\ user\ has\ selected\r\n\ \r\n
comment6.params=
comment6.target=void\ saveGame()
comment6.text=\r\n\ \r\n\ This\ method\ saves\ the\ current\ state\ of\ the\ game\ to\ a\ file\ (sudukoUI.txt)\r\n\ It\ writes\ the\ value\ of\ each\ cell\ corresponding\ to\ the\ row\ and\ column\ to\ make\ it\ easier\ to\ retrieve\ the\ values\r\n\ Also\ the\ game\ size\ is\ saved\ to\ the\ file\r\n\ \r\n\ @throws\ FileNotFoundException\ if\ the\ file\ is\ not\ found\r\n\ \r\n
comment7.params=
comment7.target=void\ loadGame()
comment7.text=\r\n\ This\ method\ loads\ the\ previously\ saved\ game\ from\ the\ file\ (sudukoUI.txt)\ in\ the\ same\ state\ it\ was\ saved\ in.\r\n\ \r\n\ @throws\ FileNotFoundException\ if\ the\ file\ is\ not\ found\r\n
comment8.params=
comment8.target=void\ undoMove()
comment8.text=\r\n\ \r\n\ This\ method\ performs\ the\ undo\ move\ resulting\ in\ the\ poping\ the\ last-in\ value\ in\ the\ ustack\r\n\ It\ will\ also\ push\ the\ move\ back\ onto\ the\ redo\ stack\ in\ case\ the\ user\ wants\ to\ redo\ the\ move\ again\r\n\ If\ there\ are\ no\ moves(empty\ stack),\ the\ method\ prints\ out\ "No\ moves\ to\ undo"\r\n\ \r\n
comment9.params=
comment9.target=void\ redoMove()
comment9.text=\r\n\ \r\n\ This\ method\ implement\ redoMove\ to\ pop\ from\ value\ from\ the\ rStack\ if\ there\ are\ any\ and\ make\ the\ move\ again\r\n\ It\ will\ also\ push\ the\ move\ back\ onto\ the\ undo\ stack\ in\ case\ the\ user\ wants\ to\ undo\ the\ move\ again\r\n\ If\ there\ are\ no\ moves(empty\ stack),\ the\ method\ prints\ out\ "No\ moves\ to\ redo"\r\n\ \r\n
numComments=14