Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Commodore » Commodore 8-bit » Day 6 of Advent of Code in Commodore 128 Basic
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Day 6 of Advent of Code in Commodore 128 Basic [message #378169] Fri, 14 December 2018 02:21 Go to next message
Anonymous
Karma:
Originally posted by: Lawrence Woodman

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-da ys-25-languages/#day6

Best wishes

Lorry

---
https://techtinkering.com - Retro Computers, Programming and General Technical Tinkering
Re: Day 6 of Advent of Code in Commodore 128 Basic [message #378171 is a reply to message #378169] Fri, 14 December 2018 02:44 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: bernardoone

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-da ys-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
Re: Day 6 of Advent of Code in Commodore 128 Basic [message #378175 is a reply to message #378171] Fri, 14 December 2018 04:12 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: Lawrence Woodman

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-da ys-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
Re: Day 6 of Advent of Code in Commodore 128 Basic [message #378179 is a reply to message #378169] Fri, 14 December 2018 06:30 Go to previous messageGo to next message
wwww.leser is currently offline  wwww.leser
Messages: 21
Registered: March 2013
Karma: 0
Junior Member
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-da ys-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?
Re: Day 6 of Advent of Code in Commodore 128 Basic [message #378182 is a reply to message #378179] Fri, 14 December 2018 08:21 Go to previous messageGo to next message
wwww.leser is currently offline  wwww.leser
Messages: 21
Registered: March 2013
Karma: 0
Junior Member
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-da ys-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.
Re: Day 6 of Advent of Code in Commodore 128 Basic [message #378190 is a reply to message #378182] Fri, 14 December 2018 12:53 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: Lawrence Woodman

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-da ys-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
Re: Day 6 of Advent of Code in Commodore 128 Basic [message #378192 is a reply to message #378190] Fri, 14 December 2018 13:30 Go to previous messageGo to next message
wwww.leser is currently offline  wwww.leser
Messages: 21
Registered: March 2013
Karma: 0
Junior Member
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-da ys-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?).
Re: Day 6 of Advent of Code in Commodore 128 Basic [message #378193 is a reply to message #378192] Fri, 14 December 2018 13:41 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: Lawrence Woodman

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-da ys-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
Re: Day 6 of Advent of Code in Commodore 128 Basic [message #378236 is a reply to message #378179] Sat, 15 December 2018 07:43 Go to previous message
Anssi Saari is currently offline  Anssi Saari
Messages: 329
Registered: January 2012
Karma: 0
Senior Member
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.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Classified top secret meetings
Next Topic: C64 Self-Extracting Archive software req.!
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Sep 25 08:49:35 EDT 2024

Total time taken to generate the page: 0.07860 seconds