2
0

Program.fs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. // Learn more about F# at http://fsharp.org
  2. open Terminal.Gui
  3. open System
  4. open System.Collections.Generic
  5. open System.Diagnostics
  6. open System.Globalization
  7. open System.Reflection
  8. open NStack
  9. type Demo() = class end
  10. let ustr (x:string) = ustring.Make(x)
  11. let mutable ml2 = Unchecked.defaultof<Label>
  12. let mutable ml = Unchecked.defaultof<Label>
  13. let mutable menu = Unchecked.defaultof<MenuBar>
  14. let mutable menuKeysStyle = Unchecked.defaultof<CheckBox>
  15. let mutable menuAutoMouseNav = Unchecked.defaultof<CheckBox>
  16. type Box10x() =
  17. inherit View()
  18. member val w = 40 with get, set
  19. member val h = 50 with get, set
  20. member val WantCursorPosition = Unchecked.defaultof<System.Boolean> with get, set
  21. new(x : int, y : int) as this =
  22. (Box10x())
  23. then
  24. ()
  25. member this.GetContentSize() =
  26. new Size(this.w, this.h)
  27. member this.SetCursorPosition(pos : Point) =
  28. raise (new NotImplementedException())
  29. override this.Redraw(region : Rect) =
  30. Application.Driver.SetAttribute (Application.Current.ColorScheme.Focus)
  31. do
  32. let mutable (y : int) = 0
  33. while (y < this.h) do
  34. this.Move (0, y)
  35. Application.Driver.AddStr (ustr (y.ToString()))
  36. do
  37. let mutable (x : int) = 0
  38. while (x < this.w - (y.ToString ()).Length) do
  39. if (y.ToString ()).Length < this.w
  40. then Application.Driver.AddStr (ustr " ")
  41. x <- x + 1
  42. x
  43. y <- y + 1
  44. y
  45. ()
  46. type Filler() =
  47. inherit View()
  48. new(rect : Rect) as this =
  49. (Filler ())
  50. then
  51. ()
  52. override this.Redraw(region : Rect) =
  53. Application.Driver.SetAttribute (Application.Current.ColorScheme.Focus)
  54. let mutable f = this.Frame
  55. do
  56. let mutable (y : int) = 0
  57. while (y < f.Width) do
  58. this.Move (0, y)
  59. do
  60. let mutable (x : int) = 0
  61. while (x < f.Height) do
  62. let mutable (r : Rune) = Unchecked.defaultof<Rune>
  63. match (x % 3) with
  64. | 0 ->
  65. Application.Driver.AddRune ((Rune ((y.ToString ()).ToCharArray (0, 1)).[0]))
  66. if y > 9
  67. then Application.Driver.AddRune ((Rune ((y.ToString ()).ToCharArray (1, 1)).[0]))
  68. r <- (Rune '.')
  69. | 1 ->
  70. r <- (Rune 'o')
  71. | _ ->
  72. r <- (Rune 'O')
  73. Application.Driver.AddRune (r)
  74. x <- x + 1
  75. x
  76. y <- y + 1
  77. y
  78. ()
  79. let ShowTextAlignments() =
  80. let mutable container = new Dialog(
  81. ustr "Text Alignments", 50, 20,
  82. new Button (ustr "Ok", true, Clicked = Action(Application.RequestStop)),
  83. new Button (ustr "Cancel", true, Clicked = Action(Application.RequestStop))
  84. )
  85. let mutable (i : int) = 0
  86. let mutable (txt : string) = "Hello world, how are you doing today"
  87. container.Add (
  88. new Label (new Rect (0, 1, 40, 3), ustr ((sprintf "%O-%O" (i + 1)) txt), TextAlignment = TextAlignment.Left),
  89. new Label (new Rect (0, 3, 40, 3), ustr ((sprintf "%O-%O" (i + 2)) txt), TextAlignment = TextAlignment.Right),
  90. new Label (new Rect (0, 5, 40, 3), ustr ((sprintf "%O-%O" (i + 3)) txt), TextAlignment = TextAlignment.Centered),
  91. new Label (new Rect (0, 7, 40, 3), ustr ((sprintf "%O-%O" (i + 4)) txt), TextAlignment = TextAlignment.Justified)
  92. )
  93. Application.Run (container)
  94. let ShowEntries(container : View) =
  95. let mutable scrollView = new ScrollView (new Rect (50, 10, 20, 8),
  96. ContentSize = new Size (20, 50),
  97. ShowVerticalScrollIndicator = true,
  98. ShowHorizontalScrollIndicator = true
  99. )
  100. scrollView.Add (new Filler(new Rect(0, 0, 40, 40)))
  101. let mutable scrollView2 = new ScrollView (new Rect (72, 10, 3, 3),
  102. ContentSize = new Size (100, 100),
  103. ShowVerticalScrollIndicator = true,
  104. ShowHorizontalScrollIndicator = true
  105. )
  106. scrollView2.Add (new Box10x(0, 0))
  107. let mutable progress = new ProgressBar(new Rect(68, 1, 10, 1))
  108. let timer = Func<MainLoop, bool> (fun (caller) ->
  109. progress.Pulse ();
  110. true)
  111. Application.MainLoop.AddTimeout (TimeSpan.FromMilliseconds (300.0), timer) |> ignore
  112. let mutable login = Label (ustr "Login: ",
  113. X = Pos.At(3),
  114. Y = Pos.At(6)
  115. )
  116. let mutable password = new Label (ustr "Password: ",
  117. X = Pos.Left (login),
  118. Y = Pos.Bottom (login) + Pos.At(1)
  119. )
  120. let mutable loginText = new TextField (ustr "",
  121. X = Pos.Right (password),
  122. Y = Pos.Top (login),
  123. Width = Dim.op_Implicit(40)
  124. )
  125. let mutable passText = new TextField (ustr "",
  126. Secret = true,
  127. X = Pos.Left (loginText),
  128. Y = Pos.Top (password),
  129. Width = Dim.Width (loginText)
  130. )
  131. let mutable tf = new Button(3, 19, ustr "Ok")
  132. container.Add (login, loginText, password, passText,
  133. new FrameView (new Rect (3, 10, 25, 6), ustr "Options",
  134. [|new CheckBox (1, 0, ustr "Remember me");
  135. new RadioGroup (1, 2, [|"_Personal"; "_Company"|])|]
  136. ),
  137. new ListView (new Rect(59, 6, 16, 4),
  138. [|"First row";
  139. "<>";
  140. "This is a very long row that should overflow what is shown";
  141. "4th";
  142. "There is an empty slot on the second row";
  143. "Whoa";
  144. "This is so cool"|]
  145. ),
  146. scrollView, scrollView2, tf,
  147. new Button(10, 19, ustr "Cancel"),
  148. new TimeField(3, 20, DateTime.Now),
  149. new TimeField(23, 20, DateTime.Now, true),
  150. new DateField(3, 22, DateTime.Now),
  151. new DateField(23, 22, DateTime.Now, true),
  152. progress,
  153. new Label(3, 24, ustr "Press F9 (on Unix, ESC+9 is an alias) to activate the menubar"),
  154. menuKeysStyle,
  155. menuAutoMouseNav
  156. )
  157. container.SendSubviewToBack (tf)
  158. ()
  159. let NewFile() =
  160. let mutable d = new Dialog (ustr "New File", 50, 20,
  161. new Button (ustr "Ok", true, Clicked = Action(Application.RequestStop)),
  162. new Button (ustr "Cancel", true, Clicked = Action(Application.RequestStop))
  163. )
  164. ml2 <- new Label(1, 1, ustr "Mouse Debug Line")
  165. d.Add (ml2)
  166. Application.Run (d)
  167. let Editor(top : Toplevel) =
  168. let mutable tframe = top.Frame
  169. let mutable ntop = new Toplevel(tframe)
  170. let mutable menu = new MenuBar([|new MenuBarItem(ustr "_File",
  171. [|new MenuItem(ustr "_Close", "", (fun () -> Application.RequestStop ()))|]);
  172. new MenuBarItem(ustr "_Edit", [|new MenuItem(ustr "_Copy", "", Unchecked.defaultof<_>);
  173. new MenuItem(ustr "C_ut", "", Unchecked.defaultof<_>);
  174. new MenuItem(ustr "_Paste", "", Unchecked.defaultof<_>)|])|]
  175. )
  176. ntop.Add (menu)
  177. let mutable (fname : string) = Unchecked.defaultof<_>
  178. for s in [|"/etc/passwd"; "c:\\windows\\win.ini"|] do
  179. if System.IO.File.Exists (s)
  180. then
  181. fname <- s
  182. let mutable win = new Window (ustr(if fname <> null then fname else "Untitled"),
  183. X = Pos.At(0),
  184. Y = Pos.At(1),
  185. Width = Dim.Fill (),
  186. Height = Dim.Fill ()
  187. )
  188. ntop.Add (win)
  189. let mutable text = new TextView(new Rect(0, 0, (tframe.Width - 2), (tframe.Height - 3)))
  190. if fname <> Unchecked.defaultof<_>
  191. then text.Text <- ustr (System.IO.File.ReadAllText (fname))
  192. win.Add (text)
  193. Application.Run (ntop)
  194. let Quit() =
  195. let mutable n = MessageBox.Query (50, 7, "Quit Demo", "Are you sure you want to quit this demo?", "Yes", "No")
  196. n = 0
  197. let Close() =
  198. MessageBox.ErrorQuery (50, 7, "Error", "There is nothing to close", "Ok")
  199. |> ignore
  200. let Open() =
  201. let mutable d = new OpenDialog (ustr "Open", ustr "Open a file", AllowsMultipleSelection = true)
  202. Application.Run (d)
  203. if not d.Canceled
  204. then MessageBox.Query (50, 7, "Selected File", (String.Join (", ", d.FilePaths)), "Ok") |> ignore
  205. let ShowHex(top : Toplevel) =
  206. let mutable tframe = top.Frame
  207. let mutable ntop = new Toplevel(tframe)
  208. let mutable menu = new MenuBar([|new MenuBarItem(ustr "_File",
  209. [|new MenuItem(ustr "_Close", "", (fun () -> Application.RequestStop ()))|])|])
  210. ntop.Add (menu)
  211. let mutable win = new Window (ustr "/etc/passwd",
  212. X = Pos.At(0),
  213. Y = Pos.At(1),
  214. Width = Dim.Fill (),
  215. Height = Dim.Fill ()
  216. )
  217. ntop.Add (win)
  218. let mutable source = System.IO.File.OpenRead ("/etc/passwd")
  219. let mutable hex = new HexView (source,
  220. X = Pos.At(0),
  221. Y = Pos.At(0),
  222. Width = Dim.Fill (),
  223. Height = Dim.Fill ()
  224. )
  225. win.Add (hex)
  226. Application.Run (ntop)
  227. type MenuItemDetails() =
  228. inherit MenuItem()
  229. new(title : ustring, help : string, action : Action) as this =
  230. (MenuItemDetails ())
  231. then
  232. this.Title <- title
  233. this.Help <- ustr help
  234. this.Action <- action
  235. static member Instance(mi : MenuItem) =
  236. (mi.GetMenuItem ()) :?> MenuItemDetails
  237. type MenuItemDelegate = delegate of MenuItemDetails -> MenuItem
  238. let ShowMenuItem(mi : MenuItemDetails) =
  239. let mutable (flags : BindingFlags) = BindingFlags.Public ||| BindingFlags.Static
  240. let mutable (minfo : MethodInfo) = typeof<MenuItemDetails>.GetMethod ("Instance", flags)
  241. let mutable (mid : Delegate) = Delegate.CreateDelegate (typeof<MenuItemDelegate>, minfo)
  242. MessageBox.Query (70, 7, (mi.Title.ToString ()),
  243. ((sprintf "%O selected. Is from submenu: %O" (mi.Title.ToString ())) (mi.GetMenuBarItem ())), "Ok")
  244. |> ignore
  245. let MenuKeysStyle_Toggled(e : EventArgs) =
  246. menu.UseKeysUpDownAsKeysLeftRight <- menuKeysStyle.Checked
  247. let MenuAutoMouseNav_Toggled(e : EventArgs) =
  248. menu.WantMousePositionReports <- menuAutoMouseNav.Checked
  249. let Copy() =
  250. let mutable (textField : TextField) = menu.LastFocused :?> TextField
  251. if textField <> Unchecked.defaultof<_> && textField.SelectedLength <> 0
  252. then textField.Copy ()
  253. ()
  254. let Cut() =
  255. let mutable (textField : TextField) = menu.LastFocused :?> TextField
  256. if textField <> Unchecked.defaultof<_> && textField.SelectedLength <> 0
  257. then textField.Cut ()
  258. ()
  259. let Paste() =
  260. let mutable (textField : TextField) = menu.LastFocused :?> TextField
  261. if textField <> Unchecked.defaultof<_>
  262. then textField.Paste ()
  263. ()
  264. let Help() =
  265. MessageBox.Query (50, 7, "Help", "This is a small help\nBe kind.", "Ok")
  266. |> ignore
  267. let ListSelectionDemo(multiple : System.Boolean) =
  268. let mutable d = new Dialog (ustr "Selection Demo", 60, 20,
  269. new Button (ustr "Ok", true, Clicked = fun () -> Application.RequestStop ()),
  270. new Button (ustr "Cancel", Clicked = fun () -> Application.RequestStop ())
  271. )
  272. let mutable animals = new List<string> ()
  273. animals.AddRange([|"Alpaca"; "Llama"; "Lion"; "Shark"; "Goat"|])
  274. let mutable msg = new Label (ustr "Use space bar or control-t to toggle selection",
  275. X = Pos.At(1),
  276. Y = Pos.At(1),
  277. Width = Dim.Fill () - Dim.op_Implicit(1),
  278. Height = Dim.op_Implicit(1)
  279. )
  280. let mutable list = new ListView (animals,
  281. X = Pos.At(1),
  282. Y = Pos.At(3),
  283. Width = Dim.Fill () - Dim.op_Implicit(4),
  284. Height = Dim.Fill () - Dim.op_Implicit(4),
  285. AllowsMarking = true,
  286. AllowsMultipleSelection = multiple
  287. )
  288. d.Add (msg, list)
  289. Application.Run (d)
  290. let mutable result = ""
  291. do
  292. let mutable (i : int) = 0
  293. while (i < animals.Count) do
  294. if list.Source.IsMarked (i)
  295. then result <- result + animals.[i] + " "
  296. i <- i + 1
  297. i
  298. ()
  299. MessageBox.Query (60, 10, "Selected Animals", (if result = "" then "No animals selected" else result), "Ok") |> ignore
  300. let OnKeyDownPressUpDemo() =
  301. let mutable container = new Dialog (ustr "KeyDown & KeyPress & KeyUp demo", 80, 20,
  302. new Button (ustr "Close", Clicked = fun () -> Application.RequestStop ()),
  303. Width = Dim.Fill (),
  304. Height = Dim.Fill ()
  305. )
  306. let mutable list = new List<string> ()
  307. let mutable listView = new ListView (list,
  308. X = Pos.At(0),
  309. Y = Pos.At(0),
  310. Width = Dim.Fill () - Dim.op_Implicit(1),
  311. Height = Dim.Fill () - Dim.op_Implicit(2)
  312. )
  313. listView.ColorScheme <- Colors.TopLevel
  314. container.Add (listView)
  315. let KeyDownPressUp(keyEvent : KeyEvent, updown : string) =
  316. let ident : int = -5
  317. match updown with
  318. | "Down"
  319. | "Up"
  320. | "Press" ->
  321. let mutable (msg : string) = sprintf "Key %5s : " updown
  322. if (keyEvent.Key &&& Key.ShiftMask) <> Key.Unknown
  323. then msg <- msg + "Shift "
  324. if (keyEvent.Key &&& Key.CtrlMask) <> Key.Unknown
  325. then msg <- msg + "Ctrl "
  326. if (keyEvent.Key &&& Key.AltMask) <> Key.Unknown
  327. then msg <- msg + "Alt "
  328. msg <- msg + if (keyEvent.KeyValue &&& (int)Key.CharMask) > 26 then (string)keyEvent.KeyValue else (string)keyEvent.Key
  329. list.Add (msg)
  330. | _ ->
  331. if (keyEvent.Key &&& Key.ShiftMask) <> Key.Unknown
  332. then list.Add (sprintf "Key %s : Shift " updown)
  333. else if (keyEvent.Key &&& Key.CtrlMask) <> Key.Unknown
  334. then list.Add (sprintf "Key %s : Ctrl " updown)
  335. else if (keyEvent.Key &&& Key.AltMask) <> Key.Unknown
  336. then list.Add (sprintf "Key %s : Alt " updown)
  337. else if ((int)keyEvent.KeyValue &&& (int)Key.CharMask) > 26
  338. then list.Add (sprintf "Key %s : %s" updown (keyEvent.KeyValue.ToString()))
  339. else list.Add (sprintf "Key %s : %s" updown (keyEvent.Key.ToString()))
  340. listView.MoveDown ();
  341. container.KeyDown.Add(fun (e : View.KeyEventEventArgs) -> KeyDownPressUp (e.KeyEvent, "Down") |> ignore)
  342. container.KeyPress.Add(fun (e : View.KeyEventEventArgs) -> KeyDownPressUp (e.KeyEvent, "Press") |> ignore)
  343. container.KeyUp.Add(fun (e : View.KeyEventEventArgs) -> KeyDownPressUp (e.KeyEvent, "Up") |> ignore)
  344. Application.Run (container)
  345. let Main() =
  346. if Debugger.IsAttached
  347. then CultureInfo.DefaultThreadCurrentUICulture <- CultureInfo.GetCultureInfo ("en-US")
  348. Application.Init ()
  349. let mutable top = Application.Top
  350. let mutable (margin : int) = 3
  351. let mutable win = new Window (ustr "Hello",
  352. X = Pos.At(1),
  353. Y = Pos.At(1),
  354. Width = Dim.Fill () - Dim.op_Implicit(margin),
  355. Height = Dim.Fill () - Dim.op_Implicit(margin)
  356. )
  357. let mutable (menuItems : MenuItemDetails[]) = [|new MenuItemDetails(ustr "F_ind", "", Unchecked.defaultof<_>);
  358. new MenuItemDetails(ustr "_Replace", "", Unchecked.defaultof<_>);
  359. new MenuItemDetails(ustr "_Item1", "", Unchecked.defaultof<_>);
  360. new MenuItemDetails(ustr "_Not From Sub Menu", "", Unchecked.defaultof<_>)|]
  361. menuItems.[0].Action <- fun () -> ShowMenuItem (menuItems.[0])
  362. menuItems.[1].Action <- fun () -> ShowMenuItem (menuItems.[1])
  363. menuItems.[2].Action <- fun () -> ShowMenuItem (menuItems.[2])
  364. menuItems.[3].Action <- fun () -> ShowMenuItem (menuItems.[3])
  365. menu <-
  366. new MenuBar ([|new MenuBarItem(ustr "_File",
  367. [|new MenuItem (ustr "Text _Editor Demo", "", (fun () -> Editor (top)));
  368. new MenuItem (ustr "_New", "Creates new file", fun () -> NewFile());
  369. new MenuItem (ustr "_Open", "", fun () -> Open());
  370. new MenuItem (ustr "_Hex", "", (fun () -> ShowHex (top)));
  371. new MenuItem (ustr "_Close", "", (fun () -> Close()));
  372. new MenuItem (ustr "_Disabled", "", (fun () -> ()), (fun () -> false));
  373. Unchecked.defaultof<_>;
  374. new MenuItem (ustr "_Quit", "", (fun () -> if Quit() then top.Running <- false))|]);
  375. new MenuBarItem (ustr "_Edit", [|new MenuItem(ustr "_Copy", "", fun () -> Copy());
  376. new MenuItem(ustr "C_ut", "", fun () -> Cut()); new MenuItem(ustr "_Paste", "", fun () -> Paste());
  377. new MenuItem(ustr "_Find and Replace", new MenuBarItem([|(menuItems.[0]);
  378. (menuItems.[1])|])); (menuItems.[3])|]);
  379. new MenuBarItem(ustr "_List Demos", [|new MenuItem(ustr "Select _Multiple Items", "", (fun () -> ListSelectionDemo (true)));
  380. new MenuItem(ustr "Select _Single Item", "", (fun () -> ListSelectionDemo (false)))|]);
  381. new MenuBarItem(ustr "A_ssorted", [|new MenuItem(ustr "_Show text alignments", "", (fun () -> ShowTextAlignments ()));
  382. new MenuItem(ustr "_OnKeyDown/Press/Up", "", (fun () -> OnKeyDownPressUpDemo ()))|]);
  383. new MenuBarItem(ustr "_Test Menu and SubMenus",
  384. [|new MenuItem(ustr "SubMenu1Item_1", new MenuBarItem([|new MenuItem(ustr "SubMenu2Item_1",
  385. new MenuBarItem([|new MenuItem(ustr "SubMenu3Item_1", new MenuBarItem([|(menuItems.[2])|]))|]))|]))|]);
  386. new MenuBarItem(ustr "_About...", "Demonstrates top-level menu item",
  387. (fun () -> MessageBox.ErrorQuery (50, 7, "About Demo", "This is a demo app for gui.cs", "Ok") |> ignore))|])
  388. menuKeysStyle <- new CheckBox(3, 25, ustr "UseKeysUpDownAsKeysLeftRight", true)
  389. menuKeysStyle.Toggled.Add(MenuKeysStyle_Toggled)
  390. menuAutoMouseNav <- new CheckBox(40, 25, ustr "UseMenuAutoNavigation", true)
  391. menuAutoMouseNav.Toggled.Add(MenuAutoMouseNav_Toggled)
  392. ShowEntries (win)
  393. let mutable (count : int) = 0
  394. ml <- new Label(new Rect(3, 17, 47, 1), ustr "Mouse: ")
  395. Application.RootMouseEvent <- Action<MouseEvent> (
  396. fun (me : MouseEvent) ->
  397. ml.TextColor <- Colors.TopLevel.Normal
  398. ml.Text <- ustr (
  399. (((sprintf "Mouse: (%O,%O) - %O %O" me.X) me.Y) me.Flags) (
  400. count <- count + 1
  401. count))
  402. )
  403. let mutable test = new Label(3, 18, ustr "Se iniciará el análisis")
  404. win.Add (test)
  405. win.Add (ml)
  406. let mutable drag = new Label (ustr "Drag: ", X = Pos.At(70), Y = Pos.At(24))
  407. let mutable dragText = new TextField (ustr "",
  408. X = Pos.Right (drag),
  409. Y = Pos.Top (drag),
  410. Width = Dim.op_Implicit(40)
  411. )
  412. let mutable statusBar = new StatusBar ([|
  413. new StatusItem(Key.F1, ustr "~F1~ Help", Action(Help));
  414. new StatusItem(Key.F2, ustr "~F2~ Load", null);
  415. new StatusItem(Key.F3, ustr "~F3~ Save", null);
  416. new StatusItem(Key.ControlX, ustr "~^X~ Quit", fun () -> if (Quit ()) then top.Running <- false)
  417. |],
  418. Parent = null
  419. )
  420. win.Add (drag, dragText)
  421. let mutable bottom = new Label(ustr "This should go on the bottom of the same top-level!")
  422. win.Add (bottom)
  423. let mutable bottom2 = new Label(ustr "This should go on the bottom of another top-level!")
  424. top.Add (bottom2)
  425. Application.Loaded.Add (
  426. fun (_) ->
  427. bottom.X <- win.X
  428. bottom.Y <- Pos.Bottom (win) - Pos.Top (win) - Pos.At(margin)
  429. bottom2.X <- Pos.Left (win)
  430. bottom2.Y <- Pos.Bottom (win)
  431. )
  432. top.Add (win)
  433. top.Add (menu, statusBar)
  434. Application.Run ()
  435. module Demo__run =
  436. [<EntryPoint>]
  437. let main argv =
  438. Main ()
  439. 0