• Day 6 of Advent of Code in Commodore 128 Basic

    From Lawrence Woodman@3:770/3 to All on Fri Dec 14 07:21:51 2018
    Hello Commodore fans,

    You may have heard of the Advent of Code challenge. For a bit of fun I
    decided to do day 6 of the challenge on the Commodore 128 using its built
    in Basic. It took days to calculate but it was great to be able to
    complete it on this machine.

    I had to use Vice though as my real machine has a memory fault which I
    need to get around to solving. The advantage of Vice was that
    I could easily transfer the code between the emulator and my Linux box to
    put it in a github repo and on my website.

    If you're interested here it is: https://techtinkering.com/articles/advent-of-code-2018-25-days-25-languages/#day6

    Best wishes

    Lorry

    ---
    https://techtinkering.com - Retro Computers, Programming and General Technical Tinkering

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From bernardoone@netzero.net@3:770/3 to Lawrence Woodman on Thu Dec 13 23:44:54 2018
    On Friday, December 14, 2018 at 2:21:52 AM UTC-5, Lawrence Woodman wrote:

    If you're interested here it is:

    https://techtinkering.com/articles/advent-of-code-2018-25-days-25-languages/#day6

    and wrote on that webpage --

    The only real problem is that it took days for it to do the calculation.

    Heh, if you had a SuperCPU 128, it would have been done more quickly. ;)

    Truly,
    Robert Bernardo
    Fresno Commodore User Group - http://www.dickestel.com/fcug.htm
    Southern California Commodore & Amiga Network - http://www.portcommodore.com/sccan

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence Woodman@3:770/3 to bernardoone on Fri Dec 14 09:12:59 2018
    On Thu, 13 Dec 2018 23:44:54 -0800, bernardoone wrote:

    On Friday, December 14, 2018 at 2:21:52 AM UTC-5, Lawrence Woodman wrote:

    If you're interested here it is:

    https://techtinkering.com/articles/advent-of-code-2018-25-days-25-languages/#day6

    and wrote on that webpage --

    The only real problem is that it took days for it to do the calculation.

    Heh, if you had a SuperCPU 128, it would have been done more quickly.
    ;)

    Interestingly, it took days even in warp mode under Vice. However, this
    was only 4 times as fast. As I understand it a supercpu would have run
    it 10-20 times as fast. So using a supercpu and doing it on retro
    hardware would have beaten a modern machine under emulation.

    Lorry

    ---
    https://techtinkering.com - Retro Computers, Programming and General
    Technical Tinkering

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From ArcadeAge@3:770/3 to Lawrence Woodman on Fri Dec 14 03:30:48 2018
    On Friday, December 14, 2018 at 8:21:52 AM UTC+1, Lawrence Woodman wrote:
    Hello Commodore fans,

    You may have heard of the Advent of Code challenge. For a bit of fun I decided to do day 6 of the challenge on the Commodore 128 using its built
    in Basic. It took days to calculate but it was great to be able to
    complete it on this machine.

    I had to use Vice though as my real machine has a memory fault which I
    need to get around to solving. The advantage of Vice was that
    I could easily transfer the code between the emulator and my Linux box to
    put it in a github repo and on my website.

    If you're interested here it is: https://techtinkering.com/articles/advent-of-code-2018-25-days-25-languages/#day6

    Best wishes

    Lorry

    ---
    https://techtinkering.com - Retro Computers, Programming and General
    Technical Tinkering

    I copied the code you published into VICE and was disappointed to get nothing but an OUT OF DATA ERROR IN 6050.
    Trying to figure out what's missing, I realized that the site you linked to merely gives a tiny example that's already solved in place.
    So I guess they give the additional problem data only to those who register (which I won't).
    Does the challenge consist in writing a fully general solution to the mathematical problem? Or are they content if your program can solve the given major problem?
    Would it be a lot of work to devise a problem instance that is too hard to solve by hand but still can be solved by a standard Commodore 128 within a few minutes?

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From ArcadeAge@3:770/3 to ArcadeAge on Fri Dec 14 05:21:40 2018
    On Friday, December 14, 2018 at 12:30:49 PM UTC+1, ArcadeAge wrote:
    On Friday, December 14, 2018 at 8:21:52 AM UTC+1, Lawrence Woodman wrote:
    Hello Commodore fans,

    You may have heard of the Advent of Code challenge. For a bit of fun I decided to do day 6 of the challenge on the Commodore 128 using its built in Basic. It took days to calculate but it was great to be able to complete it on this machine.

    I had to use Vice though as my real machine has a memory fault which I
    need to get around to solving. The advantage of Vice was that
    I could easily transfer the code between the emulator and my Linux box to put it in a github repo and on my website.

    If you're interested here it is: https://techtinkering.com/articles/advent-of-code-2018-25-days-25-languages/#day6

    Best wishes

    Lorry

    ---
    https://techtinkering.com - Retro Computers, Programming and General
    Technical Tinkering

    I copied the code you published into VICE and was disappointed to get nothing
    but an OUT OF DATA ERROR IN 6050.
    Trying to figure out what's missing, I realized that the site you linked to
    merely gives a tiny example that's already solved in place.
    So I guess they give the additional problem data only to those who register
    (which I won't).
    Does the challenge consist in writing a fully general solution to the
    mathematical problem? Or are they content if your program can solve the given major problem?
    Would it be a lot of work to devise a problem instance that is too hard to
    solve by hand but still can be solved by a standard Commodore 128 within a few minutes?

    Ok, there are enough data, but line numbers are re-used, overwriting previously
    entered code. Easy to fix.
    VICE running at ~4000% -- faster than any SuperCPU, I guess.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence Woodman@3:770/3 to ArcadeAge on Fri Dec 14 17:53:15 2018
    On Fri, 14 Dec 2018 05:21:40 -0800, ArcadeAge wrote:

    On Friday, December 14, 2018 at 12:30:49 PM UTC+1, ArcadeAge wrote:
    On Friday, December 14, 2018 at 8:21:52 AM UTC+1, Lawrence Woodman wrote:
    Hello Commodore fans,

    You may have heard of the Advent of Code challenge. For a bit of fun I
    decided to do day 6 of the challenge on the Commodore 128 using its built >> > in Basic. It took days to calculate but it was great to be able to
    complete it on this machine.

    I had to use Vice though as my real machine has a memory fault which I
    need to get around to solving. The advantage of Vice was that
    I could easily transfer the code between the emulator and my Linux box to >> > put it in a github repo and on my website.

    If you're interested here it is:
    https://techtinkering.com/articles/advent-of-code-2018-25-days-25-languages/#day6

    I copied the code you published into VICE and was disappointed to get nothing but an OUT OF DATA ERROR IN 6050.
    Trying to figure out what's missing, I realized that the site you linked to merely gives a tiny example that's already solved in place.
    So I guess they give the additional problem data only to those who register (which I won't).
    Does the challenge consist in writing a fully general solution to the mathematical problem? Or are they content if your program can solve the given major problem?
    Would it be a lot of work to devise a problem instance that is too hard to solve by hand but still can be solved by a standard Commodore 128 within a few minutes?

    Ok, there are enough data, but line numbers are re-used, overwriting
    previously entered code. Easy to fix.
    VICE running at ~4000% -- faster than any SuperCPU, I guess.

    I'm glad you noticed that. I never noticed because I used petcat to
    create the .PRG so it wasn't a problem. I have just gone back and
    changed the code. Thanks.

    4000% wow, my machine must be getting old, the most I've managed on
    vice is about 480%.

    Lorry

    ---
    https://techtinkering.com - Retro Computers, Programming and General
    Technical Tinkering

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From ArcadeAge@3:770/3 to Lawrence Woodman on Fri Dec 14 10:30:59 2018
    On Friday, December 14, 2018 at 6:53:16 PM UTC+1, Lawrence Woodman wrote:
    On Fri, 14 Dec 2018 05:21:40 -0800, ArcadeAge wrote:

    On Friday, December 14, 2018 at 12:30:49 PM UTC+1, ArcadeAge wrote:
    On Friday, December 14, 2018 at 8:21:52 AM UTC+1, Lawrence Woodman wrote: >> > Hello Commodore fans,

    You may have heard of the Advent of Code challenge. For a bit of fun I >> > decided to do day 6 of the challenge on the Commodore 128 using its
    built
    in Basic. It took days to calculate but it was great to be able to
    complete it on this machine.

    I had to use Vice though as my real machine has a memory fault which I >> > need to get around to solving. The advantage of Vice was that
    I could easily transfer the code between the emulator and my Linux box
    to
    put it in a github repo and on my website.

    If you're interested here it is:
    https://techtinkering.com/articles/advent-of-code-2018-25-days-25-languages/#day6

    I copied the code you published into VICE and was disappointed to get
    nothing but an OUT OF DATA ERROR IN 6050.
    Trying to figure out what's missing, I realized that the site you linked
    to merely gives a tiny example that's already solved in place.
    So I guess they give the additional problem data only to those who
    register (which I won't).
    Does the challenge consist in writing a fully general solution to the
    mathematical problem? Or are they content if your program can solve the given major problem?
    Would it be a lot of work to devise a problem instance that is too hard to
    solve by hand but still can be solved by a standard Commodore 128 within a few minutes?

    Ok, there are enough data, but line numbers are re-used, overwriting
    previously entered code. Easy to fix.
    VICE running at ~4000% -- faster than any SuperCPU, I guess.

    I'm glad you noticed that. I never noticed because I used petcat to
    create the .PRG so it wasn't a problem. I have just gone back and
    changed the code. Thanks.

    4000% wow, my machine must be getting old, the most I've managed on
    vice is about 480%.

    Lorry

    ---
    https://techtinkering.com - Retro Computers, Programming and General Technical Tinkering

    More likely you're running VICE with all the bells & whistles on.
    Switch off sound and true drive emulation (and anything else that's expensive to emulate).
    As I had to learn today, percentages are (of course) relative. The program runs
    even faster in 80 column fast mode, although the percentage is then only 2500 -- relative to 2 MHz, that is.

    Are any VICE developers reading this? We need a feature to pause warp mode once
    the interpreter is ready again (or waiting for keyboard input, or has printed a
    specified number of lines, or ... it's Christmas soon, isn't it?).

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence Woodman@3:770/3 to ArcadeAge on Fri Dec 14 18:41:28 2018
    On Fri, 14 Dec 2018 10:30:59 -0800, ArcadeAge wrote:

    On Friday, December 14, 2018 at 6:53:16 PM UTC+1, Lawrence Woodman wrote:
    On Fri, 14 Dec 2018 05:21:40 -0800, ArcadeAge wrote:

    On Friday, December 14, 2018 at 12:30:49 PM UTC+1, ArcadeAge wrote:
    On Friday, December 14, 2018 at 8:21:52 AM UTC+1, Lawrence Woodman wrote: >> >> > Hello Commodore fans,

    You may have heard of the Advent of Code challenge. For a bit of fun I >> >> > decided to do day 6 of the challenge on the Commodore 128 using its built
    in Basic. It took days to calculate but it was great to be able to
    complete it on this machine.

    If you're interested here it is:
    https://techtinkering.com/articles/advent-of-code-2018-25-days-25-languages/#day6
    Ok, there are enough data, but line numbers are re-used, overwriting previously entered code. Easy to fix.
    VICE running at ~4000% -- faster than any SuperCPU, I guess.

    I'm glad you noticed that. I never noticed because I used petcat to
    create the .PRG so it wasn't a problem. I have just gone back and
    changed the code. Thanks.

    4000% wow, my machine must be getting old, the most I've managed on
    vice is about 480%.

    More likely you're running VICE with all the bells & whistles on.
    Switch off sound and true drive emulation (and anything else that's expensive
    to emulate).
    As I had to learn today, percentages are (of course) relative. The program
    runs even faster in 80 column fast mode, although the percentage is then only 2500 -- relative to 2 MHz, that is.


    That's really interesting. I turned sound off and suddenly it's
    running at just over 3300% when running 80 column in fast mode.


    Lorry


    ---
    https://techtinkering.com - Retro Computers, Programming and General
    Technical Tinkering

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Anssi Saari@3:770/3 to ArcadeAge on Sat Dec 15 14:43:16 2018
    ArcadeAge <wwww.leser@gmail.com> writes:

    Does the challenge consist in writing a fully general solution to the mathematical problem? Or are they content if your program can solve
    the given major problem?

    Specific problem solving only, they expect a specific result from a
    specific set of input data. One assumes they check the answers
    automatically.

    Would it be a lot of work to devise a problem instance that is too
    hard to solve by hand but still can be solved by a standard Commodore
    128 within a few minutes?

    Probably not. I looked at the first two problems, both have two parts. I
    think a C64 (or 128) can easily do three of them. The fourth needs some
    memory where 64 or 128 KB is not enough and I at least can't see a way
    around that. Maybe with a RAM expansion. I wouldn't want to do that
    with a floppy drive although a 1581 would work. And now that I've
    thought that far, maybe I have to do just that :)

    I actually tried doing one of the Euler project problems on a C64. After
    a lot of head scratching the problem reduced to 400 additions which of
    course a C64 can do easily. Only problem was, the result needed about 36
    bits and cc65 only has 32-bit integers.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)