basic101 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +2 -0
- data/.simplecov +1 -0
- data/.yardopts +7 -0
- data/Changelog.md +3 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +75 -0
- data/LICENSE.md +9 -0
- data/README.md +193 -0
- data/Rakefile +14 -0
- data/VERSION +1 -0
- data/bin/basic101 +10 -0
- data/lib/basic101/abs_function.rb +19 -0
- data/lib/basic101/argument_checker.rb +61 -0
- data/lib/basic101/arguments.rb +32 -0
- data/lib/basic101/array_reference.rb +52 -0
- data/lib/basic101/asc_function.rb +17 -0
- data/lib/basic101/basic_array.rb +69 -0
- data/lib/basic101/basic_comparisons.rb +20 -0
- data/lib/basic101/basic_float.rb +48 -0
- data/lib/basic101/basic_integer.rb +48 -0
- data/lib/basic101/basic_math.rb +22 -0
- data/lib/basic101/basic_numeric.rb +96 -0
- data/lib/basic101/basic_object.rb +35 -0
- data/lib/basic101/basic_string.rb +85 -0
- data/lib/basic101/binary_operation.rb +32 -0
- data/lib/basic101/binary_operations.rb +26 -0
- data/lib/basic101/built_in_functions.rb +31 -0
- data/lib/basic101/chr_function.rb +17 -0
- data/lib/basic101/cos_function.rb +17 -0
- data/lib/basic101/data_statement.rb +24 -0
- data/lib/basic101/define_function_statement.rb +23 -0
- data/lib/basic101/dim_statement.rb +25 -0
- data/lib/basic101/else_statement.rb +22 -0
- data/lib/basic101/end_statement.rb +13 -0
- data/lib/basic101/endif_statement.rb +19 -0
- data/lib/basic101/errors.rb +50 -0
- data/lib/basic101/exp_function.rb +17 -0
- data/lib/basic101/for_stack.rb +48 -0
- data/lib/basic101/for_statement.rb +57 -0
- data/lib/basic101/function.rb +11 -0
- data/lib/basic101/function_call.rb +32 -0
- data/lib/basic101/function_identifier.rb +8 -0
- data/lib/basic101/functions.rb +39 -0
- data/lib/basic101/gosub_statement.rb +23 -0
- data/lib/basic101/goto_statement.rb +23 -0
- data/lib/basic101/identifier.rb +23 -0
- data/lib/basic101/identity.rb +18 -0
- data/lib/basic101/if_statement.rb +31 -0
- data/lib/basic101/input.rb +44 -0
- data/lib/basic101/input_reader.rb +55 -0
- data/lib/basic101/input_statement.rb +46 -0
- data/lib/basic101/int_function.rb +17 -0
- data/lib/basic101/left_function.rb +19 -0
- data/lib/basic101/len_function.rb +18 -0
- data/lib/basic101/let_statement.rb +24 -0
- data/lib/basic101/line.rb +32 -0
- data/lib/basic101/log_function.rb +17 -0
- data/lib/basic101/main.rb +24 -0
- data/lib/basic101/mid_function.rb +20 -0
- data/lib/basic101/negate_operation.rb +21 -0
- data/lib/basic101/next_statement.rb +34 -0
- data/lib/basic101/not_operation.rb +23 -0
- data/lib/basic101/null_prompt_delimeter.rb +12 -0
- data/lib/basic101/null_transcript.rb +20 -0
- data/lib/basic101/numeric_identifier.rb +16 -0
- data/lib/basic101/on_goto_statement.rb +29 -0
- data/lib/basic101/output.rb +73 -0
- data/lib/basic101/parser.rb +457 -0
- data/lib/basic101/power_operation.rb +24 -0
- data/lib/basic101/print_comma.rb +20 -0
- data/lib/basic101/print_semicolon.rb +19 -0
- data/lib/basic101/print_statement.rb +33 -0
- data/lib/basic101/program.rb +100 -0
- data/lib/basic101/program_counter.rb +52 -0
- data/lib/basic101/prompt_delimeter.rb +13 -0
- data/lib/basic101/randomize_statement.rb +13 -0
- data/lib/basic101/read_statement.rb +25 -0
- data/lib/basic101/reference.rb +25 -0
- data/lib/basic101/remark_statement.rb +12 -0
- data/lib/basic101/restore_statement.rb +23 -0
- data/lib/basic101/return_statement.rb +16 -0
- data/lib/basic101/right_function.rb +19 -0
- data/lib/basic101/rnd_function.rb +24 -0
- data/lib/basic101/runtime.rb +132 -0
- data/lib/basic101/scalar_reference.rb +19 -0
- data/lib/basic101/sgn_function.rb +17 -0
- data/lib/basic101/sin_function.rb +17 -0
- data/lib/basic101/sqr_function.rb +17 -0
- data/lib/basic101/statement.rb +36 -0
- data/lib/basic101/stop_statement.rb +14 -0
- data/lib/basic101/str_function.rb +16 -0
- data/lib/basic101/string_identifier.rb +16 -0
- data/lib/basic101/tab.rb +18 -0
- data/lib/basic101/tab_function.rb +17 -0
- data/lib/basic101/tan_function.rb +17 -0
- data/lib/basic101/transcript.rb +37 -0
- data/lib/basic101/transform.rb +264 -0
- data/lib/basic101/user_defined_function.rb +54 -0
- data/lib/basic101/val_function.rb +16 -0
- data/lib/basic101.rb +93 -0
- data/rake_tasks/default.rake +1 -0
- data/rake_tasks/integration.rake +8 -0
- data/rake_tasks/jeweler.rake +28 -0
- data/rake_tasks/spec.rake +8 -0
- data/rake_tasks/test.rake +2 -0
- data/rake_tasks/yard.rake +3 -0
- data/test/integration/arguments.rb +25 -0
- data/test/integration/errors.rb +7 -0
- data/test/integration/integration_test.rb +28 -0
- data/test/integration/main.rb +49 -0
- data/test/integration/output_file.rb +40 -0
- data/test/integration/test.rb +135 -0
- data/test/integration/tests/basic_computer_games/23-match.bas +64 -0
- data/test/integration/tests/basic_computer_games/23-match.input +1 -0
- data/test/integration/tests/basic_computer_games/23-match.output +29 -0
- data/test/integration/tests/basic_computer_games/3dplot.bas +17 -0
- data/test/integration/tests/basic_computer_games/3dplot.input +0 -0
- data/test/integration/tests/basic_computer_games/3dplot.output +47 -0
- data/test/integration/tests/basic_computer_games/aceyducy.bas +100 -0
- data/test/integration/tests/basic_computer_games/aceyducy.input +8 -0
- data/test/integration/tests/basic_computer_games/aceyducy.output +78 -0
- data/test/integration/tests/basic_computer_games/amazing.bas +138 -0
- data/test/integration/tests/basic_computer_games/amazing.input +1 -0
- data/test/integration/tests/basic_computer_games/amazing.output +32 -0
- data/test/integration/tests/basic_computer_games/animal.bas +71 -0
- data/test/integration/tests/basic_computer_games/animal.input +17 -0
- data/test/integration/tests/basic_computer_games/animal.output +38 -0
- data/test/integration/tests/basic_computer_games/awari.bas +70 -0
- data/test/integration/tests/basic_computer_games/awari.input +11 -0
- data/test/integration/tests/basic_computer_games/awari.output +117 -0
- data/test/integration/tests/basic_computer_games/bagels.bas +81 -0
- data/test/integration/tests/basic_computer_games/bagels.input +12 -0
- data/test/integration/tests/basic_computer_games/bagels.output +42 -0
- data/test/integration/tests/basic_computer_games/banner.bas +94 -0
- data/test/integration/tests/basic_computer_games/banner.input +6 -0
- data/test/integration/tests/basic_computer_games/banner.output +135 -0
- data/test/integration/tests/basic_computer_games/basketbl.bas +196 -0
- data/test/integration/tests/basic_computer_games/basketbl.input +46 -0
- data/test/integration/tests/basic_computer_games/basketbl.output +509 -0
- data/test/integration/tests/basic_computer_games/batnum.bas +90 -0
- data/test/integration/tests/basic_computer_games/batnum.input +14 -0
- data/test/integration/tests/basic_computer_games/batnum.output +67 -0
- data/test/integration/tests/basic_computer_games/battle.bas +196 -0
- data/test/integration/tests/basic_computer_games/battle.input +21 -0
- data/test/integration/tests/basic_computer_games/battle.output +118 -0
- data/test/integration/tests/basic_computer_games/blackjck.bas +321 -0
- data/test/integration/tests/basic_computer_games/blackjck.input +26 -0
- data/test/integration/tests/basic_computer_games/blackjck.output +144 -0
- data/test/integration/tests/basic_computer_games/bombard.bas +93 -0
- data/test/integration/tests/basic_computer_games/bombard.input +20 -0
- data/test/integration/tests/basic_computer_games/bombard.output +175 -0
- data/test/integration/tests/basic_computer_games/bounce.bas +53 -0
- data/test/integration/tests/basic_computer_games/bounce.input +0 -0
- data/test/integration/tests/basic_computer_games/bounce.output +15 -0
- data/test/integration/tests/basic_computer_games/bowling.bas +101 -0
- data/test/integration/tests/basic_computer_games/bowling.input +23 -0
- data/test/integration/tests/basic_computer_games/bowling.output +229 -0
- data/test/integration/tests/basic_computer_games/boxing.bas +142 -0
- data/test/integration/tests/basic_computer_games/boxing.input +8 -0
- data/test/integration/tests/basic_computer_games/boxing.output +47 -0
- data/test/integration/tests/basic_computer_games/bug.bas +256 -0
- data/test/integration/tests/basic_computer_games/bug.input +17 -0
- data/test/integration/tests/basic_computer_games/bug.output +847 -0
- data/test/integration/tests/basic_computer_games/bullfght.bas +193 -0
- data/test/integration/tests/basic_computer_games/bullfght.input +4 -0
- data/test/integration/tests/basic_computer_games/bullfght.output +60 -0
- data/test/integration/tests/basic_computer_games/bullseye.bas +37 -0
- data/test/integration/tests/basic_computer_games/bullseye.input +10 -0
- data/test/integration/tests/basic_computer_games/bullseye.output +79 -0
- data/test/integration/tests/basic_computer_games/bunny.bas +40 -0
- data/test/integration/tests/basic_computer_games/bunny.input +0 -0
- data/test/integration/tests/basic_computer_games/bunny.output +67 -0
- data/test/integration/tests/basic_computer_games/buzzword.bas +25 -0
- data/test/integration/tests/basic_computer_games/buzzword.input +4 -0
- data/test/integration/tests/basic_computer_games/buzzword.output +25 -0
- data/test/integration/tests/basic_computer_games/calendar.bas +58 -0
- data/test/integration/tests/basic_computer_games/calendar.input +0 -0
- data/test/integration/tests/basic_computer_games/calendar.output +213 -0
- data/test/integration/tests/basic_computer_games/change.bas +51 -0
- data/test/integration/tests/basic_computer_games/change.input +4 -0
- data/test/integration/tests/basic_computer_games/change.output +28 -0
- data/test/integration/tests/basic_computer_games/checkers.bas +82 -0
- data/test/integration/tests/basic_computer_games/checkers.input +74 -0
- data/test/integration/tests/basic_computer_games/checkers.output +673 -0
- data/test/integration/tests/basic_computer_games/chemist.bas +27 -0
- data/test/integration/tests/basic_computer_games/chemist.input +11 -0
- data/test/integration/tests/basic_computer_games/chemist.output +54 -0
- data/test/integration/tests/basic_computer_games/chief.bas +51 -0
- data/test/integration/tests/basic_computer_games/chief.input +5 -0
- data/test/integration/tests/basic_computer_games/chief.output +19 -0
- data/test/integration/tests/basic_computer_games/chomp.bas +104 -0
- data/test/integration/tests/basic_computer_games/chomp.input +15 -0
- data/test/integration/tests/basic_computer_games/chomp.output +159 -0
- data/test/integration/tests/basic_computer_games/combat.bas +124 -0
- data/test/integration/tests/basic_computer_games/combat.input +7 -0
- data/test/integration/tests/basic_computer_games/combat.output +33 -0
- data/test/integration/tests/basic_computer_games/craps.bas +82 -0
- data/test/integration/tests/basic_computer_games/craps.input +9 -0
- data/test/integration/tests/basic_computer_games/craps.output +51 -0
- data/test/integration/tests/basic_computer_games/cube.bas +161 -0
- data/test/integration/tests/basic_computer_games/cube.input +25 -0
- data/test/integration/tests/basic_computer_games/cube.output +72 -0
- data/test/integration/tests/basic_computer_games/depthchg.bas +33 -0
- data/test/integration/tests/basic_computer_games/depthchg.input +16 -0
- data/test/integration/tests/basic_computer_games/depthchg.output +83 -0
- data/test/integration/tests/basic_computer_games/diamond.bas +27 -0
- data/test/integration/tests/basic_computer_games/diamond.input +1 -0
- data/test/integration/tests/basic_computer_games/diamond.output +65 -0
- data/test/integration/tests/basic_computer_games/dice.bas +31 -0
- data/test/integration/tests/basic_computer_games/dice.input +4 -0
- data/test/integration/tests/basic_computer_games/dice.output +46 -0
- data/test/integration/tests/basic_computer_games/digits.bas +78 -0
- data/test/integration/tests/basic_computer_games/digits.input +5 -0
- data/test/integration/tests/basic_computer_games/digits.output +70 -0
- data/test/integration/tests/basic_computer_games/evenwin1.bas +128 -0
- data/test/integration/tests/basic_computer_games/evenwin1.input +13 -0
- data/test/integration/tests/basic_computer_games/evenwin1.output +116 -0
- data/test/integration/tests/basic_computer_games/evenwin2.bas +70 -0
- data/test/integration/tests/basic_computer_games/evenwin2.input +14 -0
- data/test/integration/tests/basic_computer_games/evenwin2.output +56 -0
- data/test/integration/tests/basic_computer_games/flipflop.bas +79 -0
- data/test/integration/tests/basic_computer_games/flipflop.input +8 -0
- data/test/integration/tests/basic_computer_games/flipflop.output +45 -0
- data/test/integration/tests/basic_computer_games/footbal1.bas +298 -0
- data/test/integration/tests/basic_computer_games/footbal1.input +13 -0
- data/test/integration/tests/basic_computer_games/footbal1.output +315 -0
- data/test/integration/tests/basic_computer_games/footbal2.bas +181 -0
- data/test/integration/tests/basic_computer_games/footbal2.input +23 -0
- data/test/integration/tests/basic_computer_games/footbal2.output +318 -0
- data/test/integration/tests/basic_computer_games/furtradr.bas +170 -0
- data/test/integration/tests/basic_computer_games/furtradr.input +20 -0
- data/test/integration/tests/basic_computer_games/furtradr.output +133 -0
- data/test/integration/tests/basic_computer_games/golf.bas +244 -0
- data/test/integration/tests/basic_computer_games/golf.input +11 -0
- data/test/integration/tests/basic_computer_games/golf.output +69 -0
- data/test/integration/tests/basic_computer_games/gomoko.bas +54 -0
- data/test/integration/tests/basic_computer_games/gomoko.input +6 -0
- data/test/integration/tests/basic_computer_games/gomoko.output +66 -0
- data/test/integration/tests/basic_computer_games/guess.bas +40 -0
- data/test/integration/tests/basic_computer_games/guess.input +8 -0
- data/test/integration/tests/basic_computer_games/guess.output +37 -0
- data/test/integration/tests/basic_computer_games/gunner.bas +52 -0
- data/test/integration/tests/basic_computer_games/gunner.input +18 -0
- data/test/integration/tests/basic_computer_games/gunner.output +91 -0
- data/test/integration/tests/basic_computer_games/hamurabi.bas +119 -0
- data/test/integration/tests/basic_computer_games/hamurabi.input +7 -0
- data/test/integration/tests/basic_computer_games/hamurabi.output +51 -0
- data/test/integration/tests/basic_computer_games/hangman.bas +81 -0
- data/test/integration/tests/basic_computer_games/hangman.input +69 -0
- data/test/integration/tests/basic_computer_games/hangman.output +889 -0
- data/test/integration/tests/basic_computer_games/hello.bas +83 -0
- data/test/integration/tests/basic_computer_games/hello.input +7 -0
- data/test/integration/tests/basic_computer_games/hello.output +46 -0
- data/test/integration/tests/basic_computer_games/hexapawn.bas +174 -0
- data/test/integration/tests/basic_computer_games/hexapawn.input +38 -0
- data/test/integration/tests/basic_computer_games/hexapawn.output +521 -0
- data/test/integration/tests/basic_computer_games/hi-q.bas +135 -0
- data/test/integration/tests/basic_computer_games/hi-q.input +14 -0
- data/test/integration/tests/basic_computer_games/hi-q.output +115 -0
- data/test/integration/tests/basic_computer_games/hilo.bas +29 -0
- data/test/integration/tests/basic_computer_games/hilo.input +20 -0
- data/test/integration/tests/basic_computer_games/hilo.output +76 -0
- data/test/integration/tests/basic_computer_games/hockey.bas +210 -0
- data/test/integration/tests/basic_computer_games/hockey.input +59 -0
- data/test/integration/tests/basic_computer_games/hockey.output +243 -0
- data/test/integration/tests/basic_computer_games/horsrace.bas +130 -0
- data/test/integration/tests/basic_computer_games/horsrace.input +11 -0
- data/test/integration/tests/basic_computer_games/horsrace.output +517 -0
- data/test/integration/tests/basic_computer_games/hurkle.bas +51 -0
- data/test/integration/tests/basic_computer_games/hurkle.input +16 -0
- data/test/integration/tests/basic_computer_games/hurkle.output +81 -0
- data/test/integration/tests/basic_computer_games/kinema.bas +34 -0
- data/test/integration/tests/basic_computer_games/kinema.input +9 -0
- data/test/integration/tests/basic_computer_games/kinema.output +64 -0
- data/test/integration/tests/basic_computer_games/king.bas +268 -0
- data/test/integration/tests/basic_computer_games/king.input +7 -0
- data/test/integration/tests/basic_computer_games/king.output +57 -0
- data/test/integration/tests/basic_computer_games/lem.bas +246 -0
- data/test/integration/tests/basic_computer_games/lem.input +4 -0
- data/test/integration/tests/basic_computer_games/lem.output +68 -0
- data/test/integration/tests/basic_computer_games/letter.bas +26 -0
- data/test/integration/tests/basic_computer_games/letter.input +24 -0
- data/test/integration/tests/basic_computer_games/letter.output +123 -0
- data/test/integration/tests/basic_computer_games/life.bas +66 -0
- data/test/integration/tests/basic_computer_games/life.input +4 -0
- data/test/integration/tests/basic_computer_games/life.options +1 -0
- data/test/integration/tests/basic_computer_games/life.output +200 -0
- data/test/integration/tests/basic_computer_games/life2.bas +83 -0
- data/test/integration/tests/basic_computer_games/life2.input +17 -0
- data/test/integration/tests/basic_computer_games/life2.output +113 -0
- data/test/integration/tests/basic_computer_games/litquiz.bas +49 -0
- data/test/integration/tests/basic_computer_games/litquiz.input +4 -0
- data/test/integration/tests/basic_computer_games/litquiz.output +36 -0
- data/test/integration/tests/basic_computer_games/love.bas +34 -0
- data/test/integration/tests/basic_computer_games/love.input +1 -0
- data/test/integration/tests/basic_computer_games/love.output +67 -0
- data/test/integration/tests/basic_computer_games/lunar.bas +48 -0
- data/test/integration/tests/basic_computer_games/lunar.input +87 -0
- data/test/integration/tests/basic_computer_games/lunar.output +195 -0
- data/test/integration/tests/basic_computer_games/mastrmnd.bas +232 -0
- data/test/integration/tests/basic_computer_games/mastrmnd.input +18 -0
- data/test/integration/tests/basic_computer_games/mastrmnd.output +67 -0
- data/test/integration/tests/basic_computer_games/mathdice.bas +60 -0
- data/test/integration/tests/basic_computer_games/mathdice.input +4 -0
- data/test/integration/tests/basic_computer_games/mathdice.output +86 -0
- data/test/integration/tests/basic_computer_games/mugwump.bas +56 -0
- data/test/integration/tests/basic_computer_games/mugwump.input +16 -0
- data/test/integration/tests/basic_computer_games/mugwump.output +139 -0
- data/test/integration/tests/basic_computer_games/name.bas +25 -0
- data/test/integration/tests/basic_computer_games/name.input +2 -0
- data/test/integration/tests/basic_computer_games/name.output +22 -0
- data/test/integration/tests/basic_computer_games/nicoma.bas +34 -0
- data/test/integration/tests/basic_computer_games/nicoma.input +8 -0
- data/test/integration/tests/basic_computer_games/nicoma.output +36 -0
- data/test/integration/tests/basic_computer_games/nim.bas +156 -0
- data/test/integration/tests/basic_computer_games/nim.input +8 -0
- data/test/integration/tests/basic_computer_games/nim.output +30 -0
- data/test/integration/tests/basic_computer_games/number.bas +37 -0
- data/test/integration/tests/basic_computer_games/number.input +19 -0
- data/test/integration/tests/basic_computer_games/number.output +73 -0
- data/test/integration/tests/basic_computer_games/onecheck.bas +86 -0
- data/test/integration/tests/basic_computer_games/onecheck.input +6 -0
- data/test/integration/tests/basic_computer_games/onecheck.output +77 -0
- data/test/integration/tests/basic_computer_games/orbit.bas +96 -0
- data/test/integration/tests/basic_computer_games/orbit.input +10 -0
- data/test/integration/tests/basic_computer_games/orbit.output +113 -0
- data/test/integration/tests/basic_computer_games/pizza.bas +68 -0
- data/test/integration/tests/basic_computer_games/pizza.input +10 -0
- data/test/integration/tests/basic_computer_games/pizza.output +93 -0
- data/test/integration/tests/basic_computer_games/poetry.bas +42 -0
- data/test/integration/tests/basic_computer_games/poetry.input +0 -0
- data/test/integration/tests/basic_computer_games/poetry.options +1 -0
- data/test/integration/tests/basic_computer_games/poetry.output +50 -0
- data/test/integration/tests/basic_computer_games/poker.bas +416 -0
- data/test/integration/tests/basic_computer_games/poker.input +34 -0
- data/test/integration/tests/basic_computer_games/poker.output +197 -0
- data/test/integration/tests/basic_computer_games/queen.bas +168 -0
- data/test/integration/tests/basic_computer_games/queen.input +10 -0
- data/test/integration/tests/basic_computer_games/queen.output +133 -0
- data/test/integration/tests/basic_computer_games/reverse.bas +62 -0
- data/test/integration/tests/basic_computer_games/reverse.input +12 -0
- data/test/integration/tests/basic_computer_games/reverse.output +79 -0
- data/test/integration/tests/basic_computer_games/rocket.bas +71 -0
- data/test/integration/tests/basic_computer_games/rocket.input +42 -0
- data/test/integration/tests/basic_computer_games/rocket.output +149 -0
- data/test/integration/tests/basic_computer_games/rocksp.bas +33 -0
- data/test/integration/tests/basic_computer_games/rocksp.input +9 -0
- data/test/integration/tests/basic_computer_games/rocksp.output +69 -0
- data/test/integration/tests/basic_computer_games/roulette.bas +239 -0
- data/test/integration/tests/basic_computer_games/roulette.input +9 -0
- data/test/integration/tests/basic_computer_games/roulette.output +98 -0
- data/test/integration/tests/basic_computer_games/rusrou.bas +26 -0
- data/test/integration/tests/basic_computer_games/rusrou.input +9 -0
- data/test/integration/tests/basic_computer_games/rusrou.output +50 -0
- data/test/integration/tests/basic_computer_games/salvo.bas +329 -0
- data/test/integration/tests/basic_computer_games/salvo.input +21 -0
- data/test/integration/tests/basic_computer_games/salvo.output +49 -0
- data/test/integration/tests/basic_computer_games/sinewave.bas +17 -0
- data/test/integration/tests/basic_computer_games/sinewave.input +0 -0
- data/test/integration/tests/basic_computer_games/sinewave.output +168 -0
- data/test/integration/tests/basic_computer_games/slalom.bas +165 -0
- data/test/integration/tests/basic_computer_games/slalom.input +20 -0
- data/test/integration/tests/basic_computer_games/slalom.output +122 -0
- data/test/integration/tests/basic_computer_games/slots.bas +134 -0
- data/test/integration/tests/basic_computer_games/slots.input +2 -0
- data/test/integration/tests/basic_computer_games/slots.output +20 -0
- data/test/integration/tests/basic_computer_games/splat.bas +128 -0
- data/test/integration/tests/basic_computer_games/splat.input +9 -0
- data/test/integration/tests/basic_computer_games/splat.output +61 -0
- data/test/integration/tests/basic_computer_games/stars.bas +54 -0
- data/test/integration/tests/basic_computer_games/stars.input +15 -0
- data/test/integration/tests/basic_computer_games/stars.output +70 -0
- data/test/integration/tests/basic_computer_games/stock.bas +232 -0
- data/test/integration/tests/basic_computer_games/stock.input +30 -0
- data/test/integration/tests/basic_computer_games/stock.output +156 -0
- data/test/integration/tests/basic_computer_games/superstartrek.bas +425 -0
- data/test/integration/tests/basic_computer_games/superstartrek.input +21 -0
- data/test/integration/tests/basic_computer_games/superstartrek.output +151 -0
- data/test/integration/tests/basic_computer_games/superstartrekins.bas +127 -0
- data/test/integration/tests/basic_computer_games/superstartrekins.input +1 -0
- data/test/integration/tests/basic_computer_games/superstartrekins.output +134 -0
- data/test/integration/tests/basic_computer_games/synonym.bas +53 -0
- data/test/integration/tests/basic_computer_games/synonym.input +13 -0
- data/test/integration/tests/basic_computer_games/synonym.output +57 -0
- data/test/integration/tests/basic_computer_games/target.bas +51 -0
- data/test/integration/tests/basic_computer_games/target.input +2 -0
- data/test/integration/tests/basic_computer_games/target.output +39 -0
- data/test/integration/tests/basic_computer_games/tictac1.bas +69 -0
- data/test/integration/tests/basic_computer_games/tictac1.input +10 -0
- data/test/integration/tests/basic_computer_games/tictac1.output +49 -0
- data/test/integration/tests/basic_computer_games/tictac2.bas +114 -0
- data/test/integration/tests/basic_computer_games/tictac2.input +6 -0
- data/test/integration/tests/basic_computer_games/tictac2.output +104 -0
- data/test/integration/tests/basic_computer_games/towers.bas +125 -0
- data/test/integration/tests/basic_computer_games/towers.input +9 -0
- data/test/integration/tests/basic_computer_games/towers.output +70 -0
- data/test/integration/tests/basic_computer_games/train.bas +24 -0
- data/test/integration/tests/basic_computer_games/train.input +4 -0
- data/test/integration/tests/basic_computer_games/train.output +23 -0
- data/test/integration/tests/basic_computer_games/trap.bas +49 -0
- data/test/integration/tests/basic_computer_games/trap.input +7 -0
- data/test/integration/tests/basic_computer_games/trap.output +40 -0
- data/test/integration/tests/basic_computer_games/war.bas +68 -0
- data/test/integration/tests/basic_computer_games/war.input +11 -0
- data/test/integration/tests/basic_computer_games/war.output +54 -0
- data/test/integration/tests/basic_computer_games/weekday.bas +150 -0
- data/test/integration/tests/basic_computer_games/weekday.input +2 -0
- data/test/integration/tests/basic_computer_games/weekday.output +28 -0
- data/test/integration/tests/basic_computer_games/word.bas +65 -0
- data/test/integration/tests/basic_computer_games/word.input +6 -0
- data/test/integration/tests/basic_computer_games/word.output +0 -0
- data/test/integration/tests/fast/abs.bas +5 -0
- data/test/integration/tests/fast/abs.input +0 -0
- data/test/integration/tests/fast/abs.output +5 -0
- data/test/integration/tests/fast/add.bas +5 -0
- data/test/integration/tests/fast/add.input +0 -0
- data/test/integration/tests/fast/add.output +5 -0
- data/test/integration/tests/fast/and.bas +5 -0
- data/test/integration/tests/fast/and.input +0 -0
- data/test/integration/tests/fast/and.output +5 -0
- data/test/integration/tests/fast/array.bas +11 -0
- data/test/integration/tests/fast/array.input +0 -0
- data/test/integration/tests/fast/array.output +6 -0
- data/test/integration/tests/fast/asc.bas +1 -0
- data/test/integration/tests/fast/asc.input +0 -0
- data/test/integration/tests/fast/asc.output +1 -0
- data/test/integration/tests/fast/chr.bas +1 -0
- data/test/integration/tests/fast/chr.input +0 -0
- data/test/integration/tests/fast/chr.output +1 -0
- data/test/integration/tests/fast/cos.bas +1 -0
- data/test/integration/tests/fast/cos.input +0 -0
- data/test/integration/tests/fast/cos.output +1 -0
- data/test/integration/tests/fast/def_fn.bas +9 -0
- data/test/integration/tests/fast/def_fn.input +0 -0
- data/test/integration/tests/fast/def_fn.output +5 -0
- data/test/integration/tests/fast/divide.bas +5 -0
- data/test/integration/tests/fast/divide.input +0 -0
- data/test/integration/tests/fast/divide.output +5 -0
- data/test/integration/tests/fast/end.bas +3 -0
- data/test/integration/tests/fast/end.input +0 -0
- data/test/integration/tests/fast/end.output +1 -0
- data/test/integration/tests/fast/eq.bas +3 -0
- data/test/integration/tests/fast/eq.input +0 -0
- data/test/integration/tests/fast/eq.output +3 -0
- data/test/integration/tests/fast/exp.bas +2 -0
- data/test/integration/tests/fast/exp.input +0 -0
- data/test/integration/tests/fast/exp.output +2 -0
- data/test/integration/tests/fast/float.bas +3 -0
- data/test/integration/tests/fast/float.input +0 -0
- data/test/integration/tests/fast/float.output +2 -0
- data/test/integration/tests/fast/for_next.bas +61 -0
- data/test/integration/tests/fast/for_next.input +0 -0
- data/test/integration/tests/fast/for_next.output +46 -0
- data/test/integration/tests/fast/ge.bas +3 -0
- data/test/integration/tests/fast/ge.input +0 -0
- data/test/integration/tests/fast/ge.output +3 -0
- data/test/integration/tests/fast/gosub_return.bas +10 -0
- data/test/integration/tests/fast/gosub_return.input +0 -0
- data/test/integration/tests/fast/gosub_return.output +4 -0
- data/test/integration/tests/fast/goto.bas +3 -0
- data/test/integration/tests/fast/goto.input +0 -0
- data/test/integration/tests/fast/goto.output +1 -0
- data/test/integration/tests/fast/gt.bas +3 -0
- data/test/integration/tests/fast/gt.input +0 -0
- data/test/integration/tests/fast/gt.output +3 -0
- data/test/integration/tests/fast/if.bas +25 -0
- data/test/integration/tests/fast/if.input +0 -0
- data/test/integration/tests/fast/if.output +8 -0
- data/test/integration/tests/fast/input.bas +24 -0
- data/test/integration/tests/fast/input.input +10 -0
- data/test/integration/tests/fast/input.output +28 -0
- data/test/integration/tests/fast/int.bas +5 -0
- data/test/integration/tests/fast/int.input +0 -0
- data/test/integration/tests/fast/int.output +5 -0
- data/test/integration/tests/fast/integer_plus_string.bas +1 -0
- data/test/integration/tests/fast/integer_plus_string.input +0 -0
- data/test/integration/tests/fast/integer_plus_string.output +1 -0
- data/test/integration/tests/fast/invalid_argument.bas +1 -0
- data/test/integration/tests/fast/invalid_argument.input +0 -0
- data/test/integration/tests/fast/invalid_argument.output +1 -0
- data/test/integration/tests/fast/le.bas +3 -0
- data/test/integration/tests/fast/le.input +0 -0
- data/test/integration/tests/fast/le.output +3 -0
- data/test/integration/tests/fast/left.bas +1 -0
- data/test/integration/tests/fast/left.input +0 -0
- data/test/integration/tests/fast/left.output +1 -0
- data/test/integration/tests/fast/len.bas +2 -0
- data/test/integration/tests/fast/len.input +0 -0
- data/test/integration/tests/fast/len.output +2 -0
- data/test/integration/tests/fast/let.bas +6 -0
- data/test/integration/tests/fast/let.input +0 -0
- data/test/integration/tests/fast/let.output +4 -0
- data/test/integration/tests/fast/log.bas +1 -0
- data/test/integration/tests/fast/log.input +0 -0
- data/test/integration/tests/fast/log.output +1 -0
- data/test/integration/tests/fast/lt.bas +3 -0
- data/test/integration/tests/fast/lt.input +0 -0
- data/test/integration/tests/fast/lt.output +3 -0
- data/test/integration/tests/fast/math.output +0 -0
- data/test/integration/tests/fast/mid.bas +2 -0
- data/test/integration/tests/fast/mid.input +0 -0
- data/test/integration/tests/fast/mid.output +2 -0
- data/test/integration/tests/fast/multiply.bas +5 -0
- data/test/integration/tests/fast/multiply.input +0 -0
- data/test/integration/tests/fast/multiply.output +5 -0
- data/test/integration/tests/fast/ne.bas +3 -0
- data/test/integration/tests/fast/ne.input +0 -0
- data/test/integration/tests/fast/ne.output +3 -0
- data/test/integration/tests/fast/negate.bas +4 -0
- data/test/integration/tests/fast/negate.input +0 -0
- data/test/integration/tests/fast/negate.output +3 -0
- data/test/integration/tests/fast/not.bas +4 -0
- data/test/integration/tests/fast/not.input +0 -0
- data/test/integration/tests/fast/not.output +4 -0
- data/test/integration/tests/fast/on_goto.bas +6 -0
- data/test/integration/tests/fast/on_goto.input +0 -0
- data/test/integration/tests/fast/on_goto.output +2 -0
- data/test/integration/tests/fast/or.bas +5 -0
- data/test/integration/tests/fast/or.input +0 -0
- data/test/integration/tests/fast/or.output +5 -0
- data/test/integration/tests/fast/parentheses.bas +1 -0
- data/test/integration/tests/fast/parentheses.input +0 -0
- data/test/integration/tests/fast/parentheses.output +1 -0
- data/test/integration/tests/fast/power.bas +4 -0
- data/test/integration/tests/fast/power.input +0 -0
- data/test/integration/tests/fast/power.output +4 -0
- data/test/integration/tests/fast/print.bas +6 -0
- data/test/integration/tests/fast/print.input +0 -0
- data/test/integration/tests/fast/print.output +4 -0
- data/test/integration/tests/fast/read_data.bas +15 -0
- data/test/integration/tests/fast/read_data.input +0 -0
- data/test/integration/tests/fast/read_data.output +4 -0
- data/test/integration/tests/fast/rem.bas +1 -0
- data/test/integration/tests/fast/rem.input +0 -0
- data/test/integration/tests/fast/rem.output +0 -0
- data/test/integration/tests/fast/right.bas +1 -0
- data/test/integration/tests/fast/right.input +0 -0
- data/test/integration/tests/fast/right.output +1 -0
- data/test/integration/tests/fast/rnd.bas +5 -0
- data/test/integration/tests/fast/rnd.input +0 -0
- data/test/integration/tests/fast/rnd.output +5 -0
- data/test/integration/tests/fast/sgn.bas +5 -0
- data/test/integration/tests/fast/sgn.input +0 -0
- data/test/integration/tests/fast/sgn.output +5 -0
- data/test/integration/tests/fast/sin.bas +1 -0
- data/test/integration/tests/fast/sin.input +0 -0
- data/test/integration/tests/fast/sin.output +1 -0
- data/test/integration/tests/fast/sqr.bas +2 -0
- data/test/integration/tests/fast/sqr.input +0 -0
- data/test/integration/tests/fast/sqr.output +2 -0
- data/test/integration/tests/fast/stop.bas +3 -0
- data/test/integration/tests/fast/stop.input +0 -0
- data/test/integration/tests/fast/stop.output +2 -0
- data/test/integration/tests/fast/str.bas +3 -0
- data/test/integration/tests/fast/str.input +0 -0
- data/test/integration/tests/fast/str.output +3 -0
- data/test/integration/tests/fast/string_addition.bas +1 -0
- data/test/integration/tests/fast/string_addition.input +0 -0
- data/test/integration/tests/fast/string_addition.output +1 -0
- data/test/integration/tests/fast/string_comparisons.bas +7 -0
- data/test/integration/tests/fast/string_comparisons.input +0 -0
- data/test/integration/tests/fast/string_comparisons.output +4 -0
- data/test/integration/tests/fast/string_plus_integer.bas +1 -0
- data/test/integration/tests/fast/string_plus_integer.input +0 -0
- data/test/integration/tests/fast/string_plus_integer.output +1 -0
- data/test/integration/tests/fast/subtract.bas +5 -0
- data/test/integration/tests/fast/subtract.input +0 -0
- data/test/integration/tests/fast/subtract.output +5 -0
- data/test/integration/tests/fast/tab.bas +4 -0
- data/test/integration/tests/fast/tab.input +0 -0
- data/test/integration/tests/fast/tab.output +3 -0
- data/test/integration/tests/fast/tan.bas +1 -0
- data/test/integration/tests/fast/tan.input +0 -0
- data/test/integration/tests/fast/tan.output +1 -0
- data/test/integration/tests/fast/val.bas +3 -0
- data/test/integration/tests/fast/val.input +0 -0
- data/test/integration/tests/fast/val.output +3 -0
- data/test/spec/argument_checker_spec.rb +128 -0
- data/test/spec/basic_array_spec.rb +100 -0
- data/test/spec/basic_float_spec.rb +168 -0
- data/test/spec/basic_integer_spec.rb +270 -0
- data/test/spec/basic_numeric_spec.rb +16 -0
- data/test/spec/basic_object_spec.rb +22 -0
- data/test/spec/basic_string_spec.rb +259 -0
- data/test/spec/for_stack_spec.rb +70 -0
- data/test/spec/input_reader_spec.rb +143 -0
- data/test/spec/input_spec.rb +102 -0
- data/test/spec/line_spec.rb +18 -0
- data/test/spec/output_spec.rb +153 -0
- data/test/spec/parser_spec.rb +562 -0
- data/test/spec/program_spec.rb +45 -0
- data/test/spec/spec_helper.rb +15 -0
- data/test/spec/support/basic_numeric_helpers.rb +327 -0
- data/test/spec/support/basic_object_helpers.rb +22 -0
- data/test/spec/transcript_spec.rb +37 -0
- data/test/spec/transform_spec.rb +513 -0
- metadata +742 -0
@@ -0,0 +1,329 @@
|
|
1
|
+
1000 PRINT TAB(33);"SALVO"
|
2
|
+
1010 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
|
3
|
+
1020 PRINT:PRINT:PRINT
|
4
|
+
1030 REM
|
5
|
+
1040 DIM A(10,10),B(10,10),C(7),D(7),E(12),F(12),G(12),H(12),K(10,10)
|
6
|
+
1050 Z8=0
|
7
|
+
1060 FOR W=1 TO 12
|
8
|
+
1070 E(W)=-1
|
9
|
+
1080 H(W)=-1
|
10
|
+
1090 NEXT W
|
11
|
+
1100 FOR X=1 TO 10
|
12
|
+
1110 FOR Y=1 TO 10
|
13
|
+
1120 B(X,Y)=0
|
14
|
+
1130 NEXT Y
|
15
|
+
1140 NEXT X
|
16
|
+
1150 FOR X=1 TO 12
|
17
|
+
1160 F(X)=0
|
18
|
+
1170 G(X)=0
|
19
|
+
1180 NEXT X
|
20
|
+
1190 FOR X=1 TO 10
|
21
|
+
1200 FOR Y=1 TO 10
|
22
|
+
1210 A(X,Y)=0
|
23
|
+
1220 NEXT Y
|
24
|
+
1230 NEXT X
|
25
|
+
1240 FOR K=4 TO 1 STEP -1
|
26
|
+
1250 U6=0
|
27
|
+
1260 GOSUB 2910
|
28
|
+
1270 DEF FNA(K)=(5-K)*3-2*INT(K/4)+SGN(K-1)-1
|
29
|
+
1280 DEF FNB(K)=K+INT(K/4)-SGN(K-1)
|
30
|
+
1290 IF V+V2+V*V2=0 THEN 1260
|
31
|
+
1300 IF Y+V*FNB(K)>10 THEN 1260
|
32
|
+
1310 IF Y+V*FNB(K)<1 THEN 1260
|
33
|
+
1320 IF X+V2*FNB(K)>10 THEN 1260
|
34
|
+
1330 IF X+V2*FNB(K)<1 THEN 1260
|
35
|
+
1340 U6=U6+1
|
36
|
+
1350 IF U6>25 THEN 1190
|
37
|
+
1360 FOR Z=0 TO FNB(K)
|
38
|
+
1370 F(Z+FNA(K))=X+V2*Z
|
39
|
+
1380 G(Z+FNA(K))=Y+V*Z
|
40
|
+
1390 NEXT Z
|
41
|
+
1400 U8=FNA(K)
|
42
|
+
1405 IF U8>U8+FNB(K) THEN 1460
|
43
|
+
1410 FOR Z2= U8 TO U8+FNB(K)
|
44
|
+
1415 IF U8<2 THEN 1450
|
45
|
+
1420 FOR Z3=1 TO U8-1
|
46
|
+
1430 IF SQR((F(Z3)-F(Z2))^2 + (G(Z3)-G(Z2))^2) < 3.59 THEN 1260
|
47
|
+
1440 NEXT Z3
|
48
|
+
1450 NEXT Z2
|
49
|
+
1460 FOR Z=0 TO FNB(K)
|
50
|
+
1470 A(F(Z+U8),G(Z+U8))=.5+SGN(K-1)*(K-1.5)
|
51
|
+
1480 NEXT Z
|
52
|
+
1490 NEXT K
|
53
|
+
1500 PRINT "ENTER COORDINATES FOR..."
|
54
|
+
1510 PRINT "BATTLESHIP"
|
55
|
+
1520 FOR X=1 TO 5
|
56
|
+
1530 INPUT Y,Z
|
57
|
+
1540 B(Y,Z)=3
|
58
|
+
1550 NEXT X
|
59
|
+
1560 PRINT "CRUISER"
|
60
|
+
1570 FOR X=1 TO 3
|
61
|
+
1580 INPUT Y,Z
|
62
|
+
1590 B(Y,Z)=2
|
63
|
+
1600 NEXT X
|
64
|
+
1610 PRINT "DESTROYER<A>"
|
65
|
+
1620 FOR X=1 TO 2
|
66
|
+
1630 INPUT Y,Z
|
67
|
+
1640 B(Y,Z)=1
|
68
|
+
1650 NEXT X
|
69
|
+
1660 PRINT "DESTROYER<B>"
|
70
|
+
1670 FOR X=1 TO 2
|
71
|
+
1680 INPUT Y,Z
|
72
|
+
1690 B(Y,Z)=.5
|
73
|
+
1700 NEXT X
|
74
|
+
1710 PRINT "DO YOU WANT TO START";
|
75
|
+
1720 INPUT J$
|
76
|
+
1730 IF J$<>"WHERE ARE YOUR SHIPS?" THEN 1890
|
77
|
+
1740 PRINT "BATTLESHIP"
|
78
|
+
1750 FOR Z=1 TO 5
|
79
|
+
1760 PRINT F(Z);G(Z)
|
80
|
+
1770 NEXT Z
|
81
|
+
1780 PRINT "CRUISER"
|
82
|
+
1790 PRINT F(6);G(6)
|
83
|
+
1800 PRINT F(7);G(7)
|
84
|
+
1810 PRINT F(8);G(8)
|
85
|
+
1820 PRINT "DESTROYER<A>"
|
86
|
+
1830 PRINT F(9);G(9)
|
87
|
+
1840 PRINT F(10);G(10)
|
88
|
+
1850 PRINT "DESTROYER<B>"
|
89
|
+
1860 PRINT F(11);G(11)
|
90
|
+
1870 PRINT F(12);G(12)
|
91
|
+
1880 GOTO 1710
|
92
|
+
1890 C=0
|
93
|
+
1900 PRINT "DO YOU WANT TO SEE MY SHOTS";
|
94
|
+
1910 INPUT K$
|
95
|
+
1920 PRINT
|
96
|
+
1930 IF J$<>"YES" THEN 2620
|
97
|
+
1940 REM*******************START
|
98
|
+
1950 IF J$<>"YES" THEN 1990
|
99
|
+
1960 C=C+1
|
100
|
+
1970 PRINT
|
101
|
+
1980 PRINT "TURN";C
|
102
|
+
1990 A=0
|
103
|
+
2000 FOR W=.5 TO 3 STEP .5
|
104
|
+
2010 FOR X=1 TO 10
|
105
|
+
2020 FOR Y=1 TO 10
|
106
|
+
2030 IF B(X,Y)=W THEN 2070
|
107
|
+
2040 NEXT Y
|
108
|
+
2050 NEXT X
|
109
|
+
2060 GOTO 2080
|
110
|
+
2070 A=A+INT(W+.5)
|
111
|
+
2080 NEXT W
|
112
|
+
2090 FOR W=1 TO 7
|
113
|
+
2100 C(W)=0
|
114
|
+
2110 D(W)=0
|
115
|
+
2120 F(W)=0
|
116
|
+
2130 G(W)=0
|
117
|
+
2140 NEXT W
|
118
|
+
2150 P3=0
|
119
|
+
2160 FOR X=1 TO 10
|
120
|
+
2170 FOR Y=1 TO 10
|
121
|
+
2180 IF A(X,Y)>10 THEN 2200
|
122
|
+
2190 P3=P3+1
|
123
|
+
2200 NEXT Y
|
124
|
+
2210 NEXT X
|
125
|
+
2220 PRINT "YOU HAVE";A;"SHOTS."
|
126
|
+
2230 IF P3>=A THEN 2260
|
127
|
+
2240 PRINT "YOU HAVE MORE SHOTS THAN THERE ARE BLANK SQUARES."
|
128
|
+
2250 GOTO 2890
|
129
|
+
2260 IF A<>0 THEN 2290
|
130
|
+
2270 PRINT "I HAVE WON."
|
131
|
+
2280 STOP
|
132
|
+
2290 FOR W=1 TO A
|
133
|
+
2300 INPUT X,Y
|
134
|
+
2310 IF X<>INT(X) THEN 2370
|
135
|
+
2320 IF X>10 THEN 2370
|
136
|
+
2330 IF X<1 THEN 2370
|
137
|
+
2340 IF Y<>INT(Y) THEN 2370
|
138
|
+
2350 IF Y>10 THEN 2370
|
139
|
+
2360 IF Y>=1 THEN 2390
|
140
|
+
2370 PRINT "ILLEGAL, ENTER AGAIN."
|
141
|
+
2380 GOTO 2300
|
142
|
+
2390 IF A(X,Y)>10 THEN 2440
|
143
|
+
2400 C(W)=X
|
144
|
+
2410 D(W)=Y
|
145
|
+
2420 NEXT W
|
146
|
+
2430 GOTO 2460
|
147
|
+
2440 PRINT "YOU SHOT THERE BEFORE ON TURN";A(X,Y)-10
|
148
|
+
2450 GOTO 2300
|
149
|
+
2460 FOR W=1 TO A
|
150
|
+
2470 IF A(C(W),D(W))=3 THEN 2540
|
151
|
+
2480 IF A(C(W),D(W))=2 THEN 2560
|
152
|
+
2490 IF A(C(W),D(W))=1 THEN 2580
|
153
|
+
2500 IF A(C(W),D(W))=.5 THEN 2600
|
154
|
+
2510 A(C(W),D(W))=10+C
|
155
|
+
2520 NEXT W
|
156
|
+
2530 GOTO 2620
|
157
|
+
2540 PRINT "YOU HIT MY BATTLESHIP."
|
158
|
+
2550 GOTO 2510
|
159
|
+
2560 PRINT "YOU HIT MY CRUISER."
|
160
|
+
2570 GOTO 2510
|
161
|
+
2580 PRINT "YOU HIT MY DESTROYER<A>."
|
162
|
+
2590 GOTO 2510
|
163
|
+
2600 PRINT "YOU HIT MY DESTROYER<B>."
|
164
|
+
2610 GOTO 2510
|
165
|
+
2620 A=0
|
166
|
+
2630 IF J$="YES" THEN 2670
|
167
|
+
2640 C=C+1
|
168
|
+
2650 PRINT
|
169
|
+
2660 PRINT "TURN";C
|
170
|
+
2670 A=0
|
171
|
+
2680 FOR W=.5 TO 3 STEP .5
|
172
|
+
2690 FOR X=1 TO 10
|
173
|
+
2700 FOR Y=1 TO 10
|
174
|
+
2710 IF A(X,Y)=W THEN 2750
|
175
|
+
2720 NEXT Y
|
176
|
+
2730 NEXT X
|
177
|
+
2740 GOTO 2760
|
178
|
+
2750 A=A+INT(W+.5)
|
179
|
+
2760 NEXT W
|
180
|
+
2770 P3=0
|
181
|
+
2780 FOR X=1 TO 10
|
182
|
+
2790 FOR Y=1 TO 10
|
183
|
+
2800 IF A(X,Y)>10 THEN 2820
|
184
|
+
2810 P3=P3+1
|
185
|
+
2820 NEXT Y
|
186
|
+
2830 NEXT X
|
187
|
+
2840 PRINT "I HAVE";A;"SHOTS."
|
188
|
+
2850 IF P3>A THEN 2880
|
189
|
+
2860 PRINT "I HAVE MORE SHOTS THAN BLANK SQUARES."
|
190
|
+
2870 GOTO 2270
|
191
|
+
2880 IF A<>0 THEN 2960
|
192
|
+
2890 PRINT "YOU HAVE WON."
|
193
|
+
2900 STOP
|
194
|
+
2910 X=INT(RND(1)*10+1)
|
195
|
+
2920 Y=INT(RND(1)*10+1)
|
196
|
+
2930 V=INT(3*RND(1)-1)
|
197
|
+
2940 V2=INT(3*RND(1)-1)
|
198
|
+
2950 RETURN
|
199
|
+
2960 FOR W=1 TO 12
|
200
|
+
2970 IF H(W)>0 THEN 3800
|
201
|
+
2980 NEXT W
|
202
|
+
2990 REM*******************RANDOM
|
203
|
+
3000 W=0
|
204
|
+
3010 R3=0
|
205
|
+
3020 GOSUB 2910
|
206
|
+
3030 RESTORE
|
207
|
+
3040 R2=0
|
208
|
+
3050 R3=R3+1
|
209
|
+
3060 IF R3>100 THEN 3010
|
210
|
+
3070 IF X>10 THEN 3110
|
211
|
+
3080 IF X>0 THEN 3120
|
212
|
+
3090 X=1+INT(RND(1)*2.5)
|
213
|
+
3100 GOTO 3120
|
214
|
+
3110 X=10-INT(RND(1)*2.5)
|
215
|
+
3120 IF Y>10 THEN 3160
|
216
|
+
3130 IF Y>0 THEN 3270
|
217
|
+
3140 Y=1+INT(RND(1)*2.5)
|
218
|
+
3150 GOTO 3270
|
219
|
+
3160 Y=10-INT(RND(1)*2.5)
|
220
|
+
3170 GOTO 3270
|
221
|
+
3180 F(W)=X
|
222
|
+
3190 G(W)=Y
|
223
|
+
3200 IF W=A THEN 3380
|
224
|
+
3210 IF R2=6 THEN 3030
|
225
|
+
3220 READ X1,Y1
|
226
|
+
3230 R2=R2+1
|
227
|
+
3240 DATA 1,1,-1,1,1,-3,1,1,0,2,-1,1
|
228
|
+
3250 X=X+X1
|
229
|
+
3260 Y=Y+Y1
|
230
|
+
3270 IF X>10 THEN 3210
|
231
|
+
3280 IF X<1 THEN 3210
|
232
|
+
3290 IF Y>10 THEN 3210
|
233
|
+
3300 IF Y<1 THEN 3210
|
234
|
+
3310 IF B(X,Y)>10 THEN 3210
|
235
|
+
3320 FOR Q9=1 TO W
|
236
|
+
3330 IF F(Q9)<>X THEN 3350
|
237
|
+
3340 IF G(Q9)=Y THEN 3210
|
238
|
+
3350 NEXT Q9
|
239
|
+
3360 W=W+1
|
240
|
+
3370 GOTO 3180
|
241
|
+
3380 IF K$<>"YES" THEN 3420
|
242
|
+
3390 FOR Z5=1 TO A
|
243
|
+
3400 PRINT F(Z5);G(Z5)
|
244
|
+
3410 NEXT Z5
|
245
|
+
3420 FOR W=1 TO A
|
246
|
+
3430 IF B(F(W),G(W))=3 THEN 3500
|
247
|
+
3440 IF B(F(W),G(W))=2 THEN 3520
|
248
|
+
3450 IF B(F(W),G(W))=1 THEN 3560
|
249
|
+
3460 IF B(F(W),G(W))=.5 THEN 3540
|
250
|
+
3470 B(F(W),G(W))=10+C
|
251
|
+
3480 NEXT W
|
252
|
+
3490 GOTO 1950
|
253
|
+
3500 PRINT "I HIT YOUR BATTLESHIP"
|
254
|
+
3510 GOTO 3570
|
255
|
+
3520 PRINT "I HIT YOUR CRUISER"
|
256
|
+
3530 GOTO 3570
|
257
|
+
3540 PRINT "I HIT YOUR DESTROYER<B>"
|
258
|
+
3550 GOTO 3570
|
259
|
+
3560 PRINT "I HIT YOUR DESTROYER<A>"
|
260
|
+
3570 FOR Q=1 TO 12
|
261
|
+
3580 IF E(Q)<>-1 THEN 3730
|
262
|
+
3590 E(Q)=10+C
|
263
|
+
3600 H(Q)=B(F(W),G(W))
|
264
|
+
3610 M3=0
|
265
|
+
3620 FOR M2=1 TO 12
|
266
|
+
3630 IF H(M2)<>H(Q) THEN 3650
|
267
|
+
3640 M3=M3+1
|
268
|
+
3650 NEXT M2
|
269
|
+
3660 IF M3<>INT(H(Q)+.5)+1+INT(INT(H(Q)+.5)/3) THEN 3470
|
270
|
+
3670 FOR M2=1 TO 12
|
271
|
+
3680 IF H(M2)<>H(Q) THEN 3710
|
272
|
+
3690 E(M2)=-1
|
273
|
+
3700 H(M2)=-1
|
274
|
+
3710 NEXT M2
|
275
|
+
3720 GOTO 3470
|
276
|
+
3730 NEXT Q
|
277
|
+
3740 PRINT "PROGRAM ABORT:"
|
278
|
+
3750 FOR Q=1 TO 12
|
279
|
+
3760 PRINT "E(";Q;") =";E(Q)
|
280
|
+
3770 PRINT "H(";Q;") =";H(Q)
|
281
|
+
3780 NEXT Q
|
282
|
+
3790 STOP
|
283
|
+
3800 REM************************USINGEARRAY
|
284
|
+
3810 FOR R=1 TO 10
|
285
|
+
3820 FOR S=1 TO 10
|
286
|
+
3830 K(R,S)=0
|
287
|
+
3840 NEXT S
|
288
|
+
3850 NEXT R
|
289
|
+
3860 FOR U=1 TO 12
|
290
|
+
3870 IF E(U)<10 THEN 4020
|
291
|
+
3880 FOR R=1 TO 10
|
292
|
+
3890 FOR S=1 TO 10
|
293
|
+
3900 IF B(R,S)<10 THEN 3930
|
294
|
+
3910 K(R,S)=-10000000
|
295
|
+
3920 GOTO 4000
|
296
|
+
3930 FOR M=SGN(1-R) TO SGN(10-R)
|
297
|
+
3940 FOR N=SGN(1-S) TO SGN(10-S)
|
298
|
+
3950 IF N+M+N*M=0 THEN 3980
|
299
|
+
3960 IF B(R+M,S+N)<>E(U) THEN 3980
|
300
|
+
3970 K(R,S)=K(R,S)+E(U)-S*INT(H(U)+.5)
|
301
|
+
3980 NEXT N
|
302
|
+
3990 NEXT M
|
303
|
+
4000 NEXT S
|
304
|
+
4010 NEXT R
|
305
|
+
4020 NEXT U
|
306
|
+
4030 FOR R=1 TO A
|
307
|
+
4040 F(R)=R
|
308
|
+
4050 G(R)=R
|
309
|
+
4060 NEXT R
|
310
|
+
4070 FOR R=1 TO 10
|
311
|
+
4080 FOR S=1 TO 10
|
312
|
+
4090 Q9=1
|
313
|
+
4100 FOR M=1 TO A
|
314
|
+
4110 IF K(F(M),G(M))>=K(F(Q9),G(Q9)) THEN 4130
|
315
|
+
4120 Q9=M
|
316
|
+
4130 NEXT M
|
317
|
+
4131 IF R>A THEN 4140
|
318
|
+
4132 IF R=S THEN 4210
|
319
|
+
4140 IF K(R,S)<K(F(Q9),G(Q9)) THEN 4210
|
320
|
+
4150 FOR M=1 TO A
|
321
|
+
4160 IF F(M)<>R THEN 4190
|
322
|
+
4170 IF G(M)=S THEN 4210
|
323
|
+
4180 NEXT M
|
324
|
+
4190 F(Q9)=R
|
325
|
+
4200 G(Q9)=S
|
326
|
+
4210 NEXT S
|
327
|
+
4220 NEXT R
|
328
|
+
4230 GOTO 3380
|
329
|
+
4240 END
|
@@ -0,0 +1,49 @@
|
|
1
|
+
SALVO
|
2
|
+
CREATIVE COMPUTING MORRISTOWN, NEW JERSEY
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
ENTER COORDINATES FOR...
|
7
|
+
BATTLESHIP
|
8
|
+
? 1,1
|
9
|
+
? 1,2
|
10
|
+
? 1,3
|
11
|
+
? 1,4
|
12
|
+
? 1,5
|
13
|
+
CRUISER
|
14
|
+
? 2,1
|
15
|
+
? 2,2
|
16
|
+
? 2,3
|
17
|
+
DESTROYER<A>
|
18
|
+
? 3,1
|
19
|
+
? 3,2
|
20
|
+
DESTROYER<B>
|
21
|
+
? 4,1
|
22
|
+
? 4,2
|
23
|
+
DO YOU WANT TO START? YES
|
24
|
+
DO YOU WANT TO SEE MY SHOTS? YES
|
25
|
+
|
26
|
+
|
27
|
+
TURN 1
|
28
|
+
YOU HAVE 7 SHOTS.
|
29
|
+
? 2,2
|
30
|
+
? 3,3
|
31
|
+
? 4,4
|
32
|
+
? 5,5
|
33
|
+
? 6,6
|
34
|
+
? 7,7
|
35
|
+
? 8,8
|
36
|
+
YOU HIT MY BATTLESHIP.
|
37
|
+
I HAVE 7 SHOTS.
|
38
|
+
10 8
|
39
|
+
10 10
|
40
|
+
9 10
|
41
|
+
10 9
|
42
|
+
9 8
|
43
|
+
10 7
|
44
|
+
9 9
|
45
|
+
|
46
|
+
TURN 2
|
47
|
+
YOU HAVE 7 SHOTS.
|
48
|
+
?
|
49
|
+
Error on line 2300: No more input
|
@@ -0,0 +1,17 @@
|
|
1
|
+
10 PRINT TAB(30);"SINE WAVE"
|
2
|
+
20 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
|
3
|
+
30 PRINT: PRINT: PRINT: PRINT: PRINT
|
4
|
+
40 REMARKABLE PROGRAM BY DAVID AHL
|
5
|
+
50 B=0
|
6
|
+
100 REM START LONG LOOP
|
7
|
+
110 FOR T=0 TO 40 STEP .25
|
8
|
+
120 A=INT(26+25*SIN(T))
|
9
|
+
130 PRINT TAB(A);
|
10
|
+
140 IF B=1 THEN 180
|
11
|
+
150 PRINT "CREATIVE"
|
12
|
+
160 B=1
|
13
|
+
170 GOTO 200
|
14
|
+
180 PRINT "COMPUTING"
|
15
|
+
190 B=0
|
16
|
+
200 NEXT T
|
17
|
+
999 END
|
File without changes
|
@@ -0,0 +1,168 @@
|
|
1
|
+
SINE WAVE
|
2
|
+
CREATIVE COMPUTING MORRISTOWN, NEW JERSEY
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
CREATIVE
|
9
|
+
COMPUTING
|
10
|
+
CREATIVE
|
11
|
+
COMPUTING
|
12
|
+
CREATIVE
|
13
|
+
COMPUTING
|
14
|
+
CREATIVE
|
15
|
+
COMPUTING
|
16
|
+
CREATIVE
|
17
|
+
COMPUTING
|
18
|
+
CREATIVE
|
19
|
+
COMPUTING
|
20
|
+
CREATIVE
|
21
|
+
COMPUTING
|
22
|
+
CREATIVE
|
23
|
+
COMPUTING
|
24
|
+
CREATIVE
|
25
|
+
COMPUTING
|
26
|
+
CREATIVE
|
27
|
+
COMPUTING
|
28
|
+
CREATIVE
|
29
|
+
COMPUTING
|
30
|
+
CREATIVE
|
31
|
+
COMPUTING
|
32
|
+
CREATIVE
|
33
|
+
COMPUTING
|
34
|
+
CREATIVE
|
35
|
+
COMPUTING
|
36
|
+
CREATIVE
|
37
|
+
COMPUTING
|
38
|
+
CREATIVE
|
39
|
+
COMPUTING
|
40
|
+
CREATIVE
|
41
|
+
COMPUTING
|
42
|
+
CREATIVE
|
43
|
+
COMPUTING
|
44
|
+
CREATIVE
|
45
|
+
COMPUTING
|
46
|
+
CREATIVE
|
47
|
+
COMPUTING
|
48
|
+
CREATIVE
|
49
|
+
COMPUTING
|
50
|
+
CREATIVE
|
51
|
+
COMPUTING
|
52
|
+
CREATIVE
|
53
|
+
COMPUTING
|
54
|
+
CREATIVE
|
55
|
+
COMPUTING
|
56
|
+
CREATIVE
|
57
|
+
COMPUTING
|
58
|
+
CREATIVE
|
59
|
+
COMPUTING
|
60
|
+
CREATIVE
|
61
|
+
COMPUTING
|
62
|
+
CREATIVE
|
63
|
+
COMPUTING
|
64
|
+
CREATIVE
|
65
|
+
COMPUTING
|
66
|
+
CREATIVE
|
67
|
+
COMPUTING
|
68
|
+
CREATIVE
|
69
|
+
COMPUTING
|
70
|
+
CREATIVE
|
71
|
+
COMPUTING
|
72
|
+
CREATIVE
|
73
|
+
COMPUTING
|
74
|
+
CREATIVE
|
75
|
+
COMPUTING
|
76
|
+
CREATIVE
|
77
|
+
COMPUTING
|
78
|
+
CREATIVE
|
79
|
+
COMPUTING
|
80
|
+
CREATIVE
|
81
|
+
COMPUTING
|
82
|
+
CREATIVE
|
83
|
+
COMPUTING
|
84
|
+
CREATIVE
|
85
|
+
COMPUTING
|
86
|
+
CREATIVE
|
87
|
+
COMPUTING
|
88
|
+
CREATIVE
|
89
|
+
COMPUTING
|
90
|
+
CREATIVE
|
91
|
+
COMPUTING
|
92
|
+
CREATIVE
|
93
|
+
COMPUTING
|
94
|
+
CREATIVE
|
95
|
+
COMPUTING
|
96
|
+
CREATIVE
|
97
|
+
COMPUTING
|
98
|
+
CREATIVE
|
99
|
+
COMPUTING
|
100
|
+
CREATIVE
|
101
|
+
COMPUTING
|
102
|
+
CREATIVE
|
103
|
+
COMPUTING
|
104
|
+
CREATIVE
|
105
|
+
COMPUTING
|
106
|
+
CREATIVE
|
107
|
+
COMPUTING
|
108
|
+
CREATIVE
|
109
|
+
COMPUTING
|
110
|
+
CREATIVE
|
111
|
+
COMPUTING
|
112
|
+
CREATIVE
|
113
|
+
COMPUTING
|
114
|
+
CREATIVE
|
115
|
+
COMPUTING
|
116
|
+
CREATIVE
|
117
|
+
COMPUTING
|
118
|
+
CREATIVE
|
119
|
+
COMPUTING
|
120
|
+
CREATIVE
|
121
|
+
COMPUTING
|
122
|
+
CREATIVE
|
123
|
+
COMPUTING
|
124
|
+
CREATIVE
|
125
|
+
COMPUTING
|
126
|
+
CREATIVE
|
127
|
+
COMPUTING
|
128
|
+
CREATIVE
|
129
|
+
COMPUTING
|
130
|
+
CREATIVE
|
131
|
+
COMPUTING
|
132
|
+
CREATIVE
|
133
|
+
COMPUTING
|
134
|
+
CREATIVE
|
135
|
+
COMPUTING
|
136
|
+
CREATIVE
|
137
|
+
COMPUTING
|
138
|
+
CREATIVE
|
139
|
+
COMPUTING
|
140
|
+
CREATIVE
|
141
|
+
COMPUTING
|
142
|
+
CREATIVE
|
143
|
+
COMPUTING
|
144
|
+
CREATIVE
|
145
|
+
COMPUTING
|
146
|
+
CREATIVE
|
147
|
+
COMPUTING
|
148
|
+
CREATIVE
|
149
|
+
COMPUTING
|
150
|
+
CREATIVE
|
151
|
+
COMPUTING
|
152
|
+
CREATIVE
|
153
|
+
COMPUTING
|
154
|
+
CREATIVE
|
155
|
+
COMPUTING
|
156
|
+
CREATIVE
|
157
|
+
COMPUTING
|
158
|
+
CREATIVE
|
159
|
+
COMPUTING
|
160
|
+
CREATIVE
|
161
|
+
COMPUTING
|
162
|
+
CREATIVE
|
163
|
+
COMPUTING
|
164
|
+
CREATIVE
|
165
|
+
COMPUTING
|
166
|
+
CREATIVE
|
167
|
+
COMPUTING
|
168
|
+
CREATIVE
|