Hardcode these two example programs.
Chris Pressey
6 years ago
45 | 45 | } |
46 | 46 | |
47 | 47 | private void loadExamples() { |
48 | if (examples == null) { | |
49 | examples = new ArrayList<ExampleProgram>(); | |
50 | String[][] properties = { | |
51 | {"Author", "Chris Pressey"}, | |
52 | {"License", "Public Domain"}, | |
53 | }; | |
54 | try { | |
55 | examples.add(new ExampleProgram( | |
56 | "hello, world", new URL("http://catseye.tc/projects/befunge93/eg/hello.bf"), properties | |
57 | )); | |
58 | examples.add(new ExampleProgram( | |
59 | "enigmatic aphorisms", new URL("http://catseye.tc/projects/befunge93/eg/ea.bf"), properties | |
60 | )); | |
61 | } catch (MalformedURLException e) { | |
62 | // hmm. That's too bad. | |
63 | } | |
64 | } | |
48 | if (examples != null) return; | |
49 | ||
50 | examples = new ArrayList<ExampleProgram>(); | |
51 | String[][] cpProperties = { | |
52 | {"Author", "Chris Pressey"}, | |
53 | {"License", "Public Domain"}, | |
54 | }; | |
55 | ||
56 | examples.add(new ExampleProgram( | |
57 | "hello, world", | |
58 | " v\n" + | |
59 | ">v\"Hello world!\"0<\n" + | |
60 | ",: \n" + | |
61 | "^_25*,@ \n", | |
62 | cpProperties | |
63 | )); | |
64 | examples.add(new ExampleProgram( | |
65 | "enigmatic aphorisms", | |
66 | "100p v\n" + | |
67 | " v\"love\"0 <\n" + | |
68 | " v\"power\"0 <\n" + | |
69 | " v\"strength\"0?^#< <\n" + | |
70 | " v\"success\"0 ?v\n" + | |
71 | " v\"agony\"0 <\n" + | |
72 | ">v\"beauty\"0 <>025*\".\" 1v v_^\n" + | |
73 | ",: >00g2- | v< #:\n" + | |
74 | "^_,00g1-| >0\" fo \"3>00p^<\n" + | |
75 | " >0\" eht si \"2 ^ >,^\n", | |
76 | cpProperties | |
77 | )); | |
78 | ||
65 | 79 | } |
66 | 80 | |
67 | 81 | public List<String> exampleProgramNames() { |