puzzles/maximum-profit/README.md

22 lines
795 B
Markdown
Raw Normal View History

2024-04-02 21:01:09 +00:00
# Maximum profit
Puzzle from [rendezvous with cassidoo](https://buttondown.email/cassidoo/archive/the-thermometer-of-success-is-merely-the-jealousy/) newsletter, July 23rd 2023.
Implementation in ANSI BASIC with prototype in Python.
Solution posted at https://strangeobject.space/@ooze/110770674393278897
## How to run
Edit the last `DATA` statement from the `MAXPROFIT.BAS` file to specify the sequence. Update the loop counter on line
20 to the number of elements in that sequence.
Running the code requires a BASIC intepreter such as [Bywater BASIC](https://github.com/nerun/bwbasic/) (bwBASIC). For
example, on Ubuntu, Debian, or Pop! OS systems, it can be installed from `apt install bwbasic`.
```console
bwbasic MAXPROFIT.BAS
```
Exit the interactive environment by typing Ctrl-D.