Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Where are the calculations that go with a calculated risk?


computers / comp.os.linux.advocacy / Re: A Problem To Solve :-)

SubjectAuthor
* A Problem To Solve :-)Physfitfreak
+* Re: A Problem To Solve :-)Farley Flud
|+* Re: A Problem To Solve :-)Physfitfreak
||`* Re: A Problem To Solve :-)rbowman
|| `* Re: A Problem To Solve :-)Physfitfreak
||  `* Re: A Problem To Solve :-)rbowman
||   `* Re: A Problem To Solve :-)Physfitfreak
||    `* Re: A Problem To Solve :-)rbowman
||     +* Re: A Problem To Solve :-)Chris Ahlstrom
||     |`- Re: A Problem To Solve :-)rbowman
||     `* Re: A Problem To Solve :-)Physfitfreak
||      `* Re: A Problem To Solve :-)rbowman
||       `* Re: A Problem To Solve :-)Physfitfreak
||        `* Re: A Problem To Solve :-)rbowman
||         `* Re: A Problem To Solve :-)Physfitfreak
||          +* Re: A Problem To Solve :-)Physfitfreak
||          |`* Re: A Problem To Solve :-)Physfitfreak
||          | `* Re: A Problem To Solve :-)rbowman
||          |  `- Re: A Problem To Solve :-)Physfitfreak
||          `* Re: A Problem To Solve :-)rbowman
||           `- Re: A Problem To Solve :-)Physfitfreak
|`* Re: A Problem To Solve :-)Physfitfreak
| +* Re: A Problem To Solve :-)Farley Flud
| |+- Re: A Problem To Solve :-)DFS
| |`- Re: A Problem To Solve :-)Physfitfreak
| `* Re: A Problem To Solve :-)Physfitfreak
|  +* Re: A Problem To Solve :-)Farley Flud
|  |`* Re: A Problem To Solve :-)Physfitfreak
|  | +* Re: A Problem To Solve :-)Farley Flud
|  | |+- Re: A Problem To Solve :-)Physfitfreak
|  | |+* Re: A Problem To Solve :-)DFS
|  | ||`* Re: A Problem To Solve :-)Physfitfreak
|  | || +* Re: A Problem To Solve :-)Stéphane CARPENTIER
|  | || |`* Re: A Problem To Solve :-)DFS
|  | || | `* Re: A Problem To Solve :-)DFS
|  | || |  `* Re: A Problem To Solve :-)Farley Flud
|  | || |   +* Re: A Problem To Solve :-)Farley Flud
|  | || |   |`- Re: A Problem To Solve :-)DFS
|  | || |   `- Re: A Problem To Solve :-)DFS
|  | || `* Re: A Problem To Solve :-)DFS
|  | ||  +* Re: A Problem To Solve :-)Physfitfreak
|  | ||  |+* Re: A Problem To Solve :-)Physfitfreak
|  | ||  ||+- Re: A Problem To Solve :-)DFS
|  | ||  ||`- Re: A Problem To Solve :-)Physfitfreak
|  | ||  |`- Re: A Problem To Solve :-)DFS
|  | ||  `* Re: A Problem To Solve :-)DFS
|  | ||   +* Re: A Problem To Solve :-)Physfitfreak
|  | ||   |+- Re: A Problem To Solve :-)rbowman
|  | ||   |`- Re: A Problem To Solve :-)DFS
|  | ||   `* Re: A Problem To Solve :-)Lord Master
|  | ||    +- Re: A Problem To Solve :-)DFS
|  | ||    `- Re: A Problem To Solve :-)Physfitfreak
|  | |`- Re: A Problem To Solve :-)Physfitfreak
|  | `- Re: A Problem To Solve :-)Stéphane CARPENTIER
|  +- Re: A Problem To Solve :-)Chris Ahlstrom
|  `* Re: A Problem To Solve :-)Physfitfreak
|   +* Re: A Problem To Solve :-)Farley Flud
|   |+* Re: A Problem To Solve :-)Physfitfreak
|   ||+* Re: A Problem To Solve :-)DFS
|   |||`* Re: A Problem To Solve :-)Physfitfreak
|   ||| `- Re: A Problem To Solve :-)DFS
|   ||`- Re: A Problem To Solve :-)DFS
|   |`- Re: A Problem To Solve :-)Stéphane CARPENTIER
|   +* Re: A Problem To Solve :-)DFS
|   |`* Re: A Problem To Solve :-)DFS
|   | `- Re: A Problem To Solve :-)Physfitfreak
|   +* Re: A Problem To Solve :-)Physfitfreak
|   |`* Re: A Problem To Solve :-)DFS
|   | `* Re: A Problem To Solve :-)Physfitfreak
|   |  `* Re: A Problem To Solve :-)DFS
|   |   +* Re: A Problem To Solve :-)DFS
|   |   |`* Re: A Problem To Solve :-)Physfitfreak
|   |   | `* Re: A Problem To Solve :-)DFS
|   |   |  `* Re: A Problem To Solve :-)Physfitfreak
|   |   |   +* Re: A Problem To Solve :-)DFS
|   |   |   |+* Re: A Problem To Solve :-)DFS
|   |   |   ||+* Re: A Problem To Solve :-)vallor
|   |   |   |||`- Re: A Problem To Solve :-)DFS
|   |   |   ||`- Re: A Problem To Solve :-)Physfitfreak
|   |   |   |`* Re: A Problem To Solve :-)Lord Master
|   |   |   | +* Re: A Problem To Solve :-)Physfitfreak
|   |   |   | |+- Re: A Problem To Solve :-)Lord Master
|   |   |   | |`* Re: A Problem To Solve :-)DFS
|   |   |   | | `- Re: A Problem To Solve :-)Physfitfreak
|   |   |   | +* Re: A Problem To Solve :-)DFS
|   |   |   | |`* Re: A Problem To Solve :-)Physfitfreak
|   |   |   | | `* Re: A Problem To Solve :-)DFS
|   |   |   | |  `* Re: A Problem To Solve :-)Physfitfreak
|   |   |   | |   `* Re: A Problem To Solve :-)DFS
|   |   |   | |    `- Re: A Problem To Solve :-)Physfitfreak
|   |   |   | `* Re: A Problem To Solve :-)Lord Master
|   |   |   |  `- Re: A Problem To Solve :-)Physfitfreak
|   |   |   `* Re: A Problem To Solve :-)Stéphane CARPENTIER
|   |   |    `* Re: A Problem To Solve :-)Physfitfreak
|   |   |     `* Re: A Problem To Solve :-)Stéphane CARPENTIER
|   |   |      `* Re: A Problem To Solve :-)Physfitfreak
|   |   |       `* Re: A Problem To Solve :-)Stéphane CARPENTIER
|   |   |        `* Re: A Problem To Solve :-)Physfitfreak
|   |   |         `- Re: A Problem To Solve :-)Physfitfreak
|   |   `- Re: A Problem To Solve :-)Physfitfreak
|   `* Re: A Problem To Solve :-)Physfitfreak
`- Re: A Problem To Solve :-)%

Pages:12345678910
Re: A Problem To Solve :-)

<C0GvN.48846$LONb.34039@fx08.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9149&group=comp.os.linux.advocacy#9149

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx08.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
From: nospam@dfs.com (DFS)
Subject: Re: A Problem To Solve :-)
Newsgroups: comp.os.linux.advocacy
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org>
<17b066aadb6355c7$133833$3617078$802601b3@news.usenetexpress.com>
<upme23$1b9ra$1@solani.org>
Content-Language: en-US
In-Reply-To: <upme23$1b9ra$1@solani.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 95
Message-ID: <C0GvN.48846$LONb.34039@fx08.iad>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Sun, 04 Feb 2024 06:20:18 UTC
Organization: blocknews - www.blocknews.net
Date: Sun, 4 Feb 2024 01:20:20 -0500
X-Received-Bytes: 4103
 by: DFS - Sun, 4 Feb 2024 06:20 UTC

On 2/3/2024 5:17 PM, Physfitfreak wrote:
> On 2/3/2024 10:19 AM, Farley Flud wrote:
>> On Sat, 3 Feb 2024 04:00:30 -0600, Physfitfreak wrote:
>>
>>>
>>> Thus the story continues...
>>>
>>> How many gold coins should Holaku Khan take with him to his parties?
>>>
>>
>> I'll pass.  I don't know how to play chess.  I think that, like all
>> games, chess is stupid and boring.

It's actually thrilling and challenging. It's a real downer to lose,
though.

The former cola "advocate" Branimir Maksimovic is a chess International
Master.

>> It reminds of the time I enrolled in a computer science class at
>> the university.  Our very first assignment was to write a program
>> that kept score of a bowling game.
>>
>> Bowling?  I don't fucking know how to bowl.  I never fucking went
>> bowing in my entire fucking life.
>>
>> So now I first gotta learn the rules of the game of bowling and
>> then write the program.  I said: "Fuck that!"  I just dropped the
>> course.  I'll enroll with an instructor who is progressive and sane.
>>
>
>
> Hahhahah :) Makes sense.

It makes sense to you to drop a class rather than spend 10 minutes
learning how bowling scores are calculated? It was Feeb chickening out
and running away.

> I used the chess game in this story cause it is a much, much more
> universal pastime, and very ancient. So ancient that terms associated
> with it in German and Persian are almost the same! It goes that far back.
>
> And I used only the movement types of its pieces, and nothing else. No
> other rules whatsoever.

Incorrect. You also stipulated random pieces placed randomly on the
board, making your problem invalid.

> And I assumed everybody knows that chessboard is
> an 8 squares by 8 squares board, consisting of 64 squares on which these
> pieces can move in their own ways if not blocked by another piece.
>
> This story gives an opportunity - for the code monkeys really - to try
> their use of loops within loops to solve clear but involved logical
> situations. Several arrays are involved.

You can throw a million "real programmers" at it - as you worded it, the
problem is unsolvable.

> I intended to later add one more piece to the two! :-) And then one
> more, and then one more... Then one would get very close to do what
> computer chess developers do.

Chess game developers start with known pieces at known starting
positions. Your weird problem started with random pieces at random
positions.

> But if it has to stop in this forum, before even it started, then so be it.

?

> But I still challenge everybody in this forum other than Farley, to
> salvage their fucked up images as "programmers", by writing the baby
> program that solves this problem in its most simple form, which is two
> chess pieces.

Which two? Where are they positioned? Can one piece block the other?

> It is simple enough to be done by any code monkey, and yet
> involved enough to be too time-consuming to do it "by hand".

When is your "solution" coming?

Re: A Problem To Solve :-)

<upnb48$1bn03$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9150&group=comp.os.linux.advocacy#9150

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy
Subject: Re: A Problem To Solve :-)
Date: Sun, 4 Feb 2024 00:33:44 -0600
Message-ID: <upnb48$1bn03$1@solani.org>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<17ae82c70ea94150$228$649016$802601b3@news.usenetexpress.com>
<up6lc5$11v29$3@solani.org>
<17aec41c90182031$280$639368$802601b3@news.usenetexpress.com>
<SqzuN.308058$c3Ea.149625@fx10.iad> <upeld4$162cu$2@solani.org>
<%yEvN.299033$7sbb.177002@fx16.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 4 Feb 2024 06:33:44 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1432579"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:qhDIICv4rZWCjtiLuJx2moXAz4M=
X-User-ID: eJwNyUkBwDAIBEBLEJZLDiTgX0I731ExtuswNejq3pqQvR7RL9cPvOGkhGiTAVGig+tIl2pPvUr6w5JmufE+VFMVkg==
In-Reply-To: <%yEvN.299033$7sbb.177002@fx16.iad>
Content-Language: en-US
 by: Physfitfreak - Sun, 4 Feb 2024 06:33 UTC

On 2/3/2024 10:40 PM, DFS wrote:
> On 1/31/2024 6:33 PM, Physfitfreak wrote:
>
>
>> "Each integer is made of three non-repeating digits and when you
>> divide the integers by the products of their own digits they give
>> exactly the month and the day of birthday of Holaku's beautiful
>> daughter, respectively! :)"
>> ...
>> Tusi right away gave him two other three-digit numbers that had
>> exactly the same properties!
>>
>> What was the date of Holaku's daughter's birthday?
>
>
>> can you show a computer program to do solve the proposed problem?
>
> Of course.
>
> ===================================================================
> nbr,prod,div = 0,0,0.0
> daymth = [0] * 31
>
> for i in range(1,10):
>     for j in range(1,10):
>         for k in range(1,10):
>             if (j!=i and k!=i and k!=j):
>                 nbr = int(str(i) + str(j) + str(k))
>                 prod = i * j * k;
>                 div = nbr / prod
>                 if nbr % prod == 0:
>                     if div >= 1 and div <= 31:
>                         daymth[int(div)-1] += 1
>
> for i in range(1,32):
>     if daymth[i-1] > 1:
>         if i > 12:
>             print("Birth day   = %d" % (i))
>         else:
>             print("Birth month = %d" % (i))
> ===================================================================
>
> $python age.py
> Birth month = 8
> Birth day   = 18
>
>
>
> Notice Feeb refused to show his code. That's not an oversight - he's
> afraid for others to see it.
>
>

I don't know Python. Write the code in BASIC so I can verify it. And do
not use AI to write the code for you.

Re: A Problem To Solve :-)

<upnec4$1bop5$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9153&group=comp.os.linux.advocacy#9153

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy
Subject: Re: A Problem To Solve :-)
Date: Sun, 4 Feb 2024 01:29:07 -0600
Message-ID: <upnec4$1bop5$1@solani.org>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<17ae82c70ea94150$228$649016$802601b3@news.usenetexpress.com>
<up6lc5$11v29$3@solani.org>
<17aec41c90182031$280$639368$802601b3@news.usenetexpress.com>
<SqzuN.308058$c3Ea.149625@fx10.iad> <upeld4$162cu$2@solani.org>
<%yEvN.299033$7sbb.177002@fx16.iad> <upnb48$1bn03$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 4 Feb 2024 07:29:08 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1434405"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:XXkwQ7sS15xpRTANAx4KQnr99PU=
In-Reply-To: <upnb48$1bn03$1@solani.org>
X-User-ID: eJwFwQERADEIAzBL/KD0KmcM8C/hE3h++RiJDCyWbVu3bpClU+H+ZDBHsoiDuTaFEI8GrsaKzmroLcb6B0qyFUc=
Content-Language: en-US
 by: Physfitfreak - Sun, 4 Feb 2024 07:29 UTC

On 2/4/2024 12:33 AM, Physfitfreak wrote:
> On 2/3/2024 10:40 PM, DFS wrote:
>> On 1/31/2024 6:33 PM, Physfitfreak wrote:
>>
>>
>>> "Each integer is made of three non-repeating digits and when you
>>> divide the integers by the products of their own digits they give
>>> exactly the month and the day of birthday of Holaku's beautiful
>>> daughter, respectively! :)"
>>> ...
>>> Tusi right away gave him two other three-digit numbers that had
>>> exactly the same properties!
>>>
>>> What was the date of Holaku's daughter's birthday?
>>
>>
>>> can you show a computer program to do solve the proposed problem?
>>
>> Of course.
>>
>> ===================================================================
>> nbr,prod,div = 0,0,0.0
>> daymth = [0] * 31
>>
>> for i in range(1,10):
>>      for j in range(1,10):
>>          for k in range(1,10):
>>              if (j!=i and k!=i and k!=j):
>>                  nbr = int(str(i) + str(j) + str(k))
>>                  prod = i * j * k;
>>                  div = nbr / prod
>>                  if nbr % prod == 0:
>>                      if div >= 1 and div <= 31:
>>                          daymth[int(div)-1] += 1
>>
>> for i in range(1,32):
>>      if daymth[i-1] > 1:
>>          if i > 12:
>>              print("Birth day   = %d" % (i))
>>          else:
>>              print("Birth month = %d" % (i))
>> ===================================================================
>>
>> $python age.py
>> Birth month = 8
>> Birth day   = 18
>>
>>
>>
>> Notice Feeb refused to show his code. That's not an oversight - he's
>> afraid for others to see it.
>>
>>
>
>
> I don't know Python. Write the code in BASIC so I can verify it. And do
> not use AI to write the code for you.
>
>

But looks like you've got the gist of it correctly. So never mind.

The fastest way to get to the result is not to code everything, but just
find cases of three digit integers with non-repeating digits, that when
divided by the product of their three digits would result another
integer lower than 32 (i.e. day of the month is within 1 to 31, and
month of the year is within 1 to 12). Then by looking at the output we
can detect which resulting integers were repeated and how many times.

The qbasic code for it is:

For i=1 to 9
for j = 1 to 9
if j<>i then
for k = 1 to 9
if k<>j and k<>i then
dm=(100*i + 10*j + k)/(i*j*k)
if (dm - fix(dm) < 0.00000001) and (dm > 0) and (dm < 32) then
print, i,j,k, "day or month is: ";dm
end if
end if
next k
end if
next J
next i

Which results in an output with the column list of 3 digit integers on
the left, and column for "day or month" numbers on the right. Then by
looking at day or month numbers one can see that only 8 and 18 are
repeated, and repeated twice, and one is less than 13 so the month must
be that one, and the other must then be the day of the month.

Note that since round off error in qbasic is high, instead of the "= 0"
in the if condition, I had to use "< 0.00000001" otherwise even if
correct result of division is an integer, the difference between that
number and the actual integer form of the number (fix(dm)) might not be
zero, but a very small number; in which case I would miss all such result.

So this problem was well-posed after all. The story matched the math :)

Re: A Problem To Solve :-)

<65bf9e15$0$5284$426a74cc@news.free.fr>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9161&group=comp.os.linux.advocacy#9161

  copy link   Newsgroups: comp.os.linux.advocacy sci.physics
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed1-b.proxad.net!nnrp2-2.free.fr!not-for-mail
Newsgroups: comp.os.linux.advocacy,sci.physics
From: sc@fiat-linux.fr (Stéphane CARPENTIER)
Subject: Re: A Problem To Solve :-)
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org>
<17b066aadb6355c7$133833$3617078$802601b3@news.usenetexpress.com>
Organization: Mulots' Killer
User-Agent: slrn/pre1.0.4-9 (Linux)
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Date: 04 Feb 2024 14:24:21 GMT
Lines: 25
Message-ID: <65bf9e15$0$5284$426a74cc@news.free.fr>
NNTP-Posting-Date: 04 Feb 2024 15:24:21 CET
NNTP-Posting-Host: 78.201.248.7
X-Trace: 1707056661 news-2.free.fr 5284 78.201.248.7:40974
X-Complaints-To: abuse@proxad.net
 by: Stéphane CARPENTIER - Sun, 4 Feb 2024 14:24 UTC

Le 03-02-2024, Farley Flud <ff@linux.rocks> a écrit :
> On Sat, 3 Feb 2024 04:00:30 -0600, Physfitfreak wrote:
>>
>> Thus the story continues...
>>
>> How many gold coins should Holaku Khan take with him to his parties?
>
> I'll pass. I don't know how to play chess.

That's easy to believe.

> I think

I don't believe that.

> So now I first gotta learn the rules of the game of bowling and
> then write the program. I said: "Fuck that!" I just dropped the
> course.

I believe you were unable to find the solution on Internet and found an
excuse to drop without confessing the request was beyond you capacities.

--
Si vous avez du temps à perdre :
https://scarpet42.gitlab.io

Re: A Problem To Solve :-)

<HaOvN.61195$5Hnd.52068@fx03.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9168&group=comp.os.linux.advocacy#9168

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!news.nntp4.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx03.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
From: nospam@dfs.com (DFS)
Subject: Re: A Problem To Solve :-)
Newsgroups: comp.os.linux.advocacy
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<17ae82c70ea94150$228$649016$802601b3@news.usenetexpress.com>
<up6lc5$11v29$3@solani.org>
<17aec41c90182031$280$639368$802601b3@news.usenetexpress.com>
<SqzuN.308058$c3Ea.149625@fx10.iad> <upeld4$162cu$2@solani.org>
<%yEvN.299033$7sbb.177002@fx16.iad> <upnb48$1bn03$1@solani.org>
Content-Language: en-US
In-Reply-To: <upnb48$1bn03$1@solani.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 111
Message-ID: <HaOvN.61195$5Hnd.52068@fx03.iad>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Sun, 04 Feb 2024 15:37:11 UTC
Organization: blocknews - www.blocknews.net
Date: Sun, 4 Feb 2024 10:37:14 -0500
X-Received-Bytes: 5268
 by: DFS - Sun, 4 Feb 2024 15:37 UTC

On 2/4/2024 1:33 AM, Physfitfreak wrote:
> On 2/3/2024 10:40 PM, DFS wrote:
>> On 1/31/2024 6:33 PM, Physfitfreak wrote:
>>
>>
>>> "Each integer is made of three non-repeating digits and when you
>>> divide the integers by the products of their own digits they give
>>> exactly the month and the day of birthday of Holaku's beautiful
>>> daughter, respectively! :)"
>>> ...
>>> Tusi right away gave him two other three-digit numbers that had
>>> exactly the same properties!
>>>
>>> What was the date of Holaku's daughter's birthday?
>>
>>
>>> can you show a computer program to do solve the proposed problem?
>>
>> Of course.
>>
>> ===================================================================
>> nbr,prod,div = 0,0,0.0
>> daymth = [0] * 31
>>
>> for i in range(1,10):
>>      for j in range(1,10):
>>          for k in range(1,10):
>>              if (j!=i and k!=i and k!=j):
>>                  nbr = int(str(i) + str(j) + str(k))
>>                  prod = i * j * k;
>>                  div = nbr / prod
>>                  if nbr % prod == 0:
>>                      if div >= 1 and div <= 31:
>>                          daymth[int(div)-1] += 1
>>
>> for i in range(1,32):
>>      if daymth[i-1] > 1:
>>          if i > 12:
>>              print("Birth day   = %d" % (i))
>>          else:
>>              print("Birth month = %d" % (i))
>> ===================================================================
>>
>> $python age.py
>> Birth month = 8
>> Birth day   = 18
>>
>>
>>
>> Notice Feeb refused to show his code. That's not an oversight - he's
>> afraid for others to see it.
>>
>>
>
>
> I don't know Python.

That's OK. You don't need to know much Python at all to decipher that
little bit. It is important to know Python requires/enforces tab indenting.

* the first line declares and initializes 3 variables (2 ints and a
float). You don't have to specify datatypes in Python. Python
assigns the initial datatype based on the values you first assign to
a variable.
* the second line declares and initializes a length-31 int array
containing all zeroes.
* line 3 is blank
* lines 4,5,6 start nested loops used to build the integers (note they
don't include zeroes - I wrote a version that allowed zeroes in the
integers, and it came back with a bunch of different birthdays.
* line 7 ensures the integers have no repeating digits
* line 8 converts each digit to a string, concatenates them, then
converts that string to a 3-digit integer.
* line 9 calcs the product of the digits
* line 10 divides the 3-digit integer by the product of the digits (I
call the result 'div')
* line 11 calcs a modulo to ensure the 3-digit integer is exactly
divisible by the product of the digits. Those are the only 3-digit
integers we're concerned with.
* line 12 ensures we consider only div values between 1 and 31 (days of
the month) inclusive
* line 13 increments the values in the array declared in line 2. Python
array-addressing is 0-based.
* line 14 is blank
* line 15 starts a loop to examine the counts of div in the array.
Python range(N) by default stops at N-1.
* line 16 looks for div values appearing more than once (given your
specs, I could've said = 2)
* line 17 says values above 12 are to be considered days
* line 18 prints the birth day
* line 19 is an else
* line 20 says value up to 12 are months (this is a weakness, since they
could also be days)

> Write the code in BASIC so I can verify it.

No. But it would look very similar in C and VBA.

I HIGHLY recommend you drop all Basics and start learning Python. It
has some kickass features and builtin functions that can really save
time. It's easy to learn, write and read. It's real slow at certain
things, though.

> And do not use AI to write the code for you.

I would be stunned if AI could actually write such code, or even solve
the problem without code.

Re: A Problem To Solve :-)

<1yOvN.61196$5Hnd.47319@fx03.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9169&group=comp.os.linux.advocacy#9169

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!news.niel.me!glou.org!news.glou.org!usenet-fr.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!37.252.120.71.MISMATCH!2.eu.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx03.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
From: nospam@dfs.com (DFS)
Subject: Re: A Problem To Solve :-)
Newsgroups: comp.os.linux.advocacy
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<17ae82c70ea94150$228$649016$802601b3@news.usenetexpress.com>
<up6lc5$11v29$3@solani.org>
<17aec41c90182031$280$639368$802601b3@news.usenetexpress.com>
<SqzuN.308058$c3Ea.149625@fx10.iad> <upeld4$162cu$2@solani.org>
<%yEvN.299033$7sbb.177002@fx16.iad> <upnb48$1bn03$1@solani.org>
<upnec4$1bop5$1@solani.org>
Content-Language: en-US
In-Reply-To: <upnec4$1bop5$1@solani.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 64
Message-ID: <1yOvN.61196$5Hnd.47319@fx03.iad>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Sun, 04 Feb 2024 16:02:05 UTC
Organization: blocknews - www.blocknews.net
Date: Sun, 4 Feb 2024 11:02:08 -0500
X-Received-Bytes: 3602
 by: DFS - Sun, 4 Feb 2024 16:02 UTC

On 2/4/2024 2:29 AM, Physfitfreak wrote:

>> I don't know Python. Write the code in BASIC so I can verify it. And
>> do not use AI to write the code for you.
>>
>
> But looks like you've got the gist of it correctly. So never mind.
>
> The fastest way to get to the result is not to code everything, but just
> find cases of three digit integers with non-repeating digits, that when
> divided by the product of their three digits would result another
> integer lower than 32 (i.e. day of the month is within 1 to 31, and
> month of the year is within 1 to 12). Then by looking at the output we
> can detect which resulting integers were repeated and how many times.

No sense in writing partial code - a few more lines and the computer
does everything for you.

> The qbasic code for it is:
>
> For i=1 to 9
>   for j = 1 to 9
>     if j<>i then
>       for k = 1 to 9
>         if k<>j and k<>i then
>           dm=(100*i + 10*j + k)/(i*j*k)
>           if (dm - fix(dm) < 0.00000001) and (dm > 0) and (dm < 32) then
>             print, i,j,k, "day or month is: ";dm
>           end if
>         end if
>       next k
>     end if
>   next J
> next i
>
> Which results in an output with the column list of 3 digit integers on
> the left, and column for "day or month" numbers on the right. Then by
> looking at day or month numbers one can see that only 8 and 18 are
> repeated, and repeated twice, and one is less than 13 so the month must
> be that one, and the other must then be the day of the month.

The computer can suss that better and faster than us.

So do yourself a favor and finish the QBasic code so it identifies the
birthday for you.

> Note that since round off error in qbasic is high, instead of the "= 0"
> in the if condition, I had to use "< 0.00000001" otherwise even if
> correct result of division is an integer, the difference between that
> number and the actual integer form of the number (fix(dm)) might not be
> zero, but a very small number; in which case I would miss all such result.
>
> So this problem was well-posed after all. The story matched the math :)

Is it a Persian thing to dress up simple math problems with long, weird,
elaborate stories, replete with magic mountains and plush carpets and
virginal daughters and princes carrying bags of gold coins?

Or are you high when you post such nutty problems?

Re: A Problem To Solve :-)

<gqQvN.46602$mMj7.42181@fx01.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9185&group=comp.os.linux.advocacy#9185

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!news.chmurka.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx01.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
From: nospam@dfs.com (DFS)
Subject: Re: A Problem To Solve :-)
Newsgroups: comp.os.linux.advocacy
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<17ae82c70ea94150$228$649016$802601b3@news.usenetexpress.com>
<up6lc5$11v29$3@solani.org>
<17aec41c90182031$280$639368$802601b3@news.usenetexpress.com>
<SqzuN.308058$c3Ea.149625@fx10.iad> <upeld4$162cu$2@solani.org>
<%yEvN.299033$7sbb.177002@fx16.iad>
Content-Language: en-US
In-Reply-To: <%yEvN.299033$7sbb.177002@fx16.iad>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 131
Message-ID: <gqQvN.46602$mMj7.42181@fx01.iad>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Sun, 04 Feb 2024 18:10:20 UTC
Organization: blocknews - www.blocknews.net
Date: Sun, 4 Feb 2024 13:10:19 -0500
X-Received-Bytes: 4538
 by: DFS - Sun, 4 Feb 2024 18:10 UTC

On 2/3/2024 11:40 PM, DFS wrote:
> On 1/31/2024 6:33 PM, Physfitfreak wrote:
>> can you show a computer program to do solve the proposed problem?
>
> Of course.
>
> ===================================================================
> nbr,prod,div = 0,0,0.0
> daymth = [0] * 31
>
> for i in range(1,10):
>     for j in range(1,10):
>         for k in range(1,10):
>             if (j!=i and k!=i and k!=j):
>                 nbr = int(str(i) + str(j) + str(k))
>                 prod = i * j * k;
>                 div = nbr / prod
>                 if nbr % prod == 0:
>                     if div >= 1 and div <= 31:
>                         daymth[int(div)-1] += 1
>
> for i in range(1,32):
>     if daymth[i-1] > 1:
>         if i > 12:
>             print("Birth day   = %d" % (i))
>         else:
>             print("Birth month = %d" % (i))
> ===================================================================
>
> $python age.py
> Birth month = 8
> Birth day   = 18

===================================================================
C version
===================================================================
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void) {

int i,j,k,nbr,prod;
char nbrstr[4];
double div;
int daymth[31] = {0};

for (i = 1; i < 10; i++) {
for (j = 1; j < 10; j++) {
for (k = 1; k < 10; k++) {
if (j!=i && k!=i && k!=j) {
sprintf(nbrstr,"%d%d%d", i,j,k);
nbr = atoi(nbrstr);
prod = i*j*k;
div = (double)nbr / (double)prod;
if (nbr % prod == 0) {
if (div >= 1 && div <= 31) {
//printf("Nbr=%d, Product=%d, Div=%.f\n",nbr,prod,div);
daymth[(int)(div)-1] += 1;
}
}
}
}
}
}

for (i=1;i<=31;i++) {
//printf("%d\n", daymth[i-1]);
if (daymth[i-1] > 1) {
if (i > 12)
{printf("Birth day = %d\n", i);}
else
{printf("Birth month = %d\n", i);}
}
}

return(0);
} ===================================================================
$ ./age
Birth month = 8
Birth day = 18

===================================================================
VBA version (runs unchanged in Access 2003 and Excel 2003)
===================================================================
Dim i, j, k, nbr, prod As Integer, div As Single
Dim daymth(31) As Integer

For i = 0 To 30
daymth(i) = 0
Next

For i = 1 To 9
For j = 1 To 9
For k = 1 To 9
If j <> i And k <> i And k <> j Then
nbr = CInt(CStr(i) & CStr(j) & CStr(k))
prod = i * j * k
div = nbr / prod
If nbr Mod prod = 0 Then
If div >= 1 And div <= 31 Then
daymth(CInt(div) - 1) = daymth(CInt(div) - 1) + 1
End If
End If
End If
Next
Next
Next

For i = 1 To 31
If daymth(i - 1) > 1 Then
If i > 12 Then
Debug.Print "Birth day = " & i
Else
Debug.Print "Birth month = " & i
End If
End If
Next
===================================================================
output in immediate window
Birth month = 8
Birth day = 18

Re: A Problem To Solve :-)

<upookr$1cftj$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9189&group=comp.os.linux.advocacy#9189

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy
Subject: Re: A Problem To Solve :-)
Date: Sun, 4 Feb 2024 13:30:35 -0600
Message-ID: <upookr$1cftj$1@solani.org>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<17ae82c70ea94150$228$649016$802601b3@news.usenetexpress.com>
<up6lc5$11v29$3@solani.org>
<17aec41c90182031$280$639368$802601b3@news.usenetexpress.com>
<SqzuN.308058$c3Ea.149625@fx10.iad> <upeld4$162cu$2@solani.org>
<%yEvN.299033$7sbb.177002@fx16.iad> <upnb48$1bn03$1@solani.org>
<upnec4$1bop5$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 4 Feb 2024 19:30:35 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1458099"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:DaPOCXEz7lIm1xpnAzSemMMQYqY=
X-User-ID: eJwFwYEBwDAEBMCV6MeTcRD2H6F3BirbD43H1rY843LEnNtX1MNzVsE3qCTETsw3bTfl6edSeB2RKNR09g9OyBXu
Content-Language: en-US
In-Reply-To: <upnec4$1bop5$1@solani.org>
 by: Physfitfreak - Sun, 4 Feb 2024 19:30 UTC

On 2/4/2024 1:29 AM, Physfitfreak wrote:
> So this problem was well-posed after all. The story matched the math :)

"Well-posed" in the sense that if, for instance, there were more than
two repeating numbers in the list of "day or month" column, say, two
occurrences of 11's as well, then one could know neither the day nor the
month of her birthday. So I'm glad the result showed otherwise :)

Well, back then, I don't know how many decades ago, I had made sure this
was not the case anyway. But I don't remember how I knew it. I could've
solved it myself back then, or the math discussion of that feature about
3 digit integers itself proved it, in wherever article it was that I was
reading; by all probability one in a Scientific American magazine.

Re: A Problem To Solve :-)

<upop5v$1cftj$2@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9190&group=comp.os.linux.advocacy#9190

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy
Subject: Re: A Problem To Solve :-)
Date: Sun, 4 Feb 2024 13:39:43 -0600
Message-ID: <upop5v$1cftj$2@solani.org>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<17ae82c70ea94150$228$649016$802601b3@news.usenetexpress.com>
<up6lc5$11v29$3@solani.org>
<17aec41c90182031$280$639368$802601b3@news.usenetexpress.com>
<SqzuN.308058$c3Ea.149625@fx10.iad> <upeld4$162cu$2@solani.org>
<%yEvN.299033$7sbb.177002@fx16.iad> <gqQvN.46602$mMj7.42181@fx01.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 4 Feb 2024 19:39:43 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1458099"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:xMulXdDC1hvVgXm95Gcy1a8fAhs=
In-Reply-To: <gqQvN.46602$mMj7.42181@fx01.iad>
Content-Language: en-US
X-User-ID: eJwNyskBACAIA7CV5Kp1HEXYfwTNO2EQ5HQEPDraovfGdjmpHBPBcllnqarU1eI9/M+xkiyO/PNaimVNd/YDR+MVPw==
 by: Physfitfreak - Sun, 4 Feb 2024 19:39 UTC

On 2/4/2024 12:10 PM, DFS wrote:
> On 2/3/2024 11:40 PM, DFS wrote:
>> On 1/31/2024 6:33 PM, Physfitfreak wrote:
>>> can you show a computer program to do solve the proposed problem?
>>
>> Of course.
>>
>> ===================================================================
>> nbr,prod,div = 0,0,0.0
>> daymth = [0] * 31
>>
>> for i in range(1,10):
>>      for j in range(1,10):
>>          for k in range(1,10):
>>              if (j!=i and k!=i and k!=j):
>>                  nbr = int(str(i) + str(j) + str(k))
>>                  prod = i * j * k;
>>                  div = nbr / prod
>>                  if nbr % prod == 0:
>>                      if div >= 1 and div <= 31:
>>                          daymth[int(div)-1] += 1
>>
>> for i in range(1,32):
>>      if daymth[i-1] > 1:
>>          if i > 12:
>>              print("Birth day   = %d" % (i))
>>          else:
>>              print("Birth month = %d" % (i))
>> ===================================================================
>>
>> $python age.py
>> Birth month = 8
>> Birth day   = 18
>
>
>
> ===================================================================
> C version
> ===================================================================
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
>
> int main(void) {
>
>   int i,j,k,nbr,prod;
>   char nbrstr[4];
>   double div;
>   int daymth[31] = {0};
>
>   for (i = 1; i < 10; i++) {
>     for (j = 1; j < 10; j++) {
>       for (k = 1; k < 10; k++) {
>         if (j!=i && k!=i && k!=j) {
>           sprintf(nbrstr,"%d%d%d", i,j,k);
>           nbr = atoi(nbrstr);
>           prod = i*j*k;
>           div = (double)nbr / (double)prod;
>           if (nbr % prod == 0) {
>             if (div >= 1 && div <= 31) {
>               //printf("Nbr=%d, Product=%d, Div=%.f\n",nbr,prod,div);
>               daymth[(int)(div)-1] += 1;
>             }
>           }
>         }
>       }
>     }
>   }
>
>   for (i=1;i<=31;i++) {
>     //printf("%d\n", daymth[i-1]);
>     if (daymth[i-1] > 1) {
>       if (i > 12)
>           {printf("Birth day   = %d\n", i);}
>         else
>           {printf("Birth month = %d\n", i);}
>     }
>   }
>
>   return(0);
> }
> ===================================================================
> $ ./age
> Birth month = 8
> Birth day   = 18
>
>
>
>
>
> ===================================================================
> VBA version (runs unchanged in Access 2003 and Excel 2003)
> ===================================================================
> Dim i, j, k, nbr, prod As Integer, div As Single
> Dim daymth(31) As Integer
>
> For i = 0 To 30
>  daymth(i) = 0
> Next
>
> For i = 1 To 9
>   For j = 1 To 9
>     For k = 1 To 9
>       If j <> i And k <> i And k <> j Then
>         nbr = CInt(CStr(i) & CStr(j) & CStr(k))
>         prod = i * j * k
>         div = nbr / prod
>         If nbr Mod prod = 0 Then
>           If div >= 1 And div <= 31 Then
>             daymth(CInt(div) - 1) = daymth(CInt(div) - 1) + 1
>           End If
>         End If
>       End If
>     Next
>   Next
> Next
>
> For i = 1 To 31
>   If daymth(i - 1) > 1 Then
>     If i > 12 Then
>         Debug.Print "Birth day   =  " & i
>       Else
>         Debug.Print "Birth month =  " & i
>     End If
>   End If
> Next
> ===================================================================
> output in immediate window
> Birth month = 8
> Birth day   = 18
>
>

Highly suspect to be the product of a simple AI request.

You can't prove your status of "code monkey" to me by posting codes in
any language. You prove _not_ to have that status by totally getting
confused about my chess problem that I proposed.

That's where you show yourself, not in the codes that you may have
copied and pasted.

Re: A Problem To Solve :-)

<l2a9l9Ff3qU4@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9194&group=comp.os.linux.advocacy#9194

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bowman@montana.com (rbowman)
Newsgroups: comp.os.linux.advocacy
Subject: Re: A Problem To Solve :-)
Date: 4 Feb 2024 20:16:42 GMT
Lines: 9
Message-ID: <l2a9l9Ff3qU4@mid.individual.net>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<17ae82c70ea94150$228$649016$802601b3@news.usenetexpress.com>
<up6lc5$11v29$3@solani.org>
<17aec41c90182031$280$639368$802601b3@news.usenetexpress.com>
<SqzuN.308058$c3Ea.149625@fx10.iad> <upeld4$162cu$2@solani.org>
<%yEvN.299033$7sbb.177002@fx16.iad> <gqQvN.46602$mMj7.42181@fx01.iad>
<upop5v$1cftj$2@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net /hJtumGsxYkZEwm9vvKVkwn+hDqMz9v4qTjBghmFtFEuTmGVx+
Cancel-Lock: sha1:3+bdJerGc76dvRAKylIaCXPJhQs= sha256:+NvC1x5NvVmsWt3+usnyAvQeOPZ48zC4k7FokUrsh+c=
User-Agent: Pan/0.149 (Bellevue; 4c157ba)
 by: rbowman - Sun, 4 Feb 2024 20:16 UTC

On Sun, 4 Feb 2024 13:39:43 -0600, Physfitfreak wrote:

> You can't prove your status of "code monkey" to me by posting codes in
> any language. You prove _not_ to have that status by totally getting
> confused about my chess problem that I proposed.

In my FORTRAN IV class in 1965 we did a few chess problems. someone was
going to write a complete chess program real soon any day now. Hubris is a
wonderful thing.

Re: A Problem To Solve :-)

<2YSvN.86996$TSTa.54743@fx47.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9198&group=comp.os.linux.advocacy#9198

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx47.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
From: nospam@dfs.com (DFS)
Subject: Re: A Problem To Solve :-)
Newsgroups: comp.os.linux.advocacy
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<17ae82c70ea94150$228$649016$802601b3@news.usenetexpress.com>
<up6lc5$11v29$3@solani.org>
<17aec41c90182031$280$639368$802601b3@news.usenetexpress.com>
<SqzuN.308058$c3Ea.149625@fx10.iad> <upeld4$162cu$2@solani.org>
<%yEvN.299033$7sbb.177002@fx16.iad> <gqQvN.46602$mMj7.42181@fx01.iad>
<upop5v$1cftj$2@solani.org>
Content-Language: en-US
In-Reply-To: <upop5v$1cftj$2@solani.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 174
Message-ID: <2YSvN.86996$TSTa.54743@fx47.iad>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Sun, 04 Feb 2024 21:02:54 UTC
Organization: blocknews - www.blocknews.net
Date: Sun, 4 Feb 2024 16:02:54 -0500
X-Received-Bytes: 6715
 by: DFS - Sun, 4 Feb 2024 21:02 UTC

On 2/4/2024 2:39 PM, Physfitfreak wrote:
> On 2/4/2024 12:10 PM, DFS wrote:
>> On 2/3/2024 11:40 PM, DFS wrote:
>>> On 1/31/2024 6:33 PM, Physfitfreak wrote:
>>>> can you show a computer program to do solve the proposed problem?
>>>
>>> Of course.
>>>
>>> ===================================================================
>>> nbr,prod,div = 0,0,0.0
>>> daymth = [0] * 31
>>>
>>> for i in range(1,10):
>>>      for j in range(1,10):
>>>          for k in range(1,10):
>>>              if (j!=i and k!=i and k!=j):
>>>                  nbr = int(str(i) + str(j) + str(k))
>>>                  prod = i * j * k;
>>>                  div = nbr / prod
>>>                  if nbr % prod == 0:
>>>                      if div >= 1 and div <= 31:
>>>                          daymth[int(div)-1] += 1
>>>
>>> for i in range(1,32):
>>>      if daymth[i-1] > 1:
>>>          if i > 12:
>>>              print("Birth day   = %d" % (i))
>>>          else:
>>>              print("Birth month = %d" % (i))
>>> ===================================================================
>>>
>>> $python age.py
>>> Birth month = 8
>>> Birth day   = 18
>>
>>
>>
>> ===================================================================
>> C version
>> ===================================================================
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <string.h>
>>
>> int main(void) {
>>
>>    int i,j,k,nbr,prod;
>>    char nbrstr[4];
>>    double div;
>>    int daymth[31] = {0};
>>
>>    for (i = 1; i < 10; i++) {
>>      for (j = 1; j < 10; j++) {
>>        for (k = 1; k < 10; k++) {
>>          if (j!=i && k!=i && k!=j) {
>>            sprintf(nbrstr,"%d%d%d", i,j,k);
>>            nbr = atoi(nbrstr);
>>            prod = i*j*k;
>>            div = (double)nbr / (double)prod;
>>            if (nbr % prod == 0) {
>>              if (div >= 1 && div <= 31) {
>>                //printf("Nbr=%d, Product=%d, Div=%.f\n",nbr,prod,div);
>>                daymth[(int)(div)-1] += 1;
>>              }
>>            }
>>          }
>>        }
>>      }
>>    }
>>
>>    for (i=1;i<=31;i++) {
>>      //printf("%d\n", daymth[i-1]);
>>      if (daymth[i-1] > 1) {
>>        if (i > 12)
>>            {printf("Birth day   = %d\n", i);}
>>          else
>>            {printf("Birth month = %d\n", i);}
>>      }
>>    }
>>
>>    return(0);
>> }
>> ===================================================================
>> $ ./age
>> Birth month = 8
>> Birth day   = 18
>>
>>
>>
>>
>>
>> ===================================================================
>> VBA version (runs unchanged in Access 2003 and Excel 2003)
>> ===================================================================
>> Dim i, j, k, nbr, prod As Integer, div As Single
>> Dim daymth(31) As Integer
>>
>> For i = 0 To 30
>>   daymth(i) = 0
>> Next
>>
>> For i = 1 To 9
>>    For j = 1 To 9
>>      For k = 1 To 9
>>        If j <> i And k <> i And k <> j Then
>>          nbr = CInt(CStr(i) & CStr(j) & CStr(k))
>>          prod = i * j * k
>>          div = nbr / prod
>>          If nbr Mod prod = 0 Then
>>            If div >= 1 And div <= 31 Then
>>              daymth(CInt(div) - 1) = daymth(CInt(div) - 1) + 1
>>            End If
>>          End If
>>        End If
>>      Next
>>    Next
>> Next
>>
>> For i = 1 To 31
>>    If daymth(i - 1) > 1 Then
>>      If i > 12 Then
>>          Debug.Print "Birth day   =  " & i
>>        Else
>>          Debug.Print "Birth month =  " & i
>>      End If
>>    End If
>> Next
>> ===================================================================
>> output in immediate window
>> Birth month = 8
>> Birth day   = 18
>>
>>
>
>
> Highly suspect to be the product of a simple AI request.

'suspect' only in the mind of a weird sand chimp who's embarrassed he
can't write such simple programs, even after decades of coding experience.

But go ahead and show me the AI program that generates such code, bozo.
I'll be waiting.

> You can't prove your status of "code monkey" to me by posting codes in
> any language.

I was curious how the same program looked, side by side, so I knocked
out the C and VBA versions this morning, in no time. Python is the
shortest and tidiest, as it usually is.

I notice "code monkey" is used only by the worst programmers on cola:
Feeb and you.

> You prove _not_ to have that status by totally getting
> confused about my chess problem that I proposed.

I still don't know what you were asking. I suspect you don't, either.
And you still haven't offered any solutions.

Next time pass it by a native English speaker before posting. And drop
all the fancy, irrelevant stories. It's math or logic, not bedtime
fantasies.

> That's where you show yourself, not in the codes that you may have
> copied and pasted.

Study and learn from them. You won't find them anywhere on the planet
but right here on cola. But feel free to spend days looking.

Re: A Problem To Solve :-)

<uppf2e$1bq1i$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9213&group=comp.os.linux.advocacy#9213

  copy link   Newsgroups: comp.os.linux.advocacy sci.physics
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy,sci.physics
Subject: Re: A Problem To Solve :-)
Date: Sun, 4 Feb 2024 19:53:17 -0600
Message-ID: <uppf2e$1bq1i$1@solani.org>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 5 Feb 2024 01:53:18 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1435698"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:0mZgDvTBtbzSuWM2DLB4KUfj2Fg=
Content-Language: en-US
X-User-ID: eJwNyMEBwCAIA8CVBELAcRBl/xHae54bhR2gEz4+S8Zylo7ewwnssI2qvucBssb8afHwtbRJEvAoZXen/msfU3gViQ==
In-Reply-To: <upl2ru$19kpu$1@solani.org>
 by: Physfitfreak - Mon, 5 Feb 2024 01:53 UTC

On 2/3/2024 4:00 AM, Physfitfreak wrote:
> "In each of my parties, a session is always included in which a
> chessboard is placed on the floor, with no chess pieces on it. There is
> a contest, and the winner is blindfolded and given two random chess
> pieces of same color - but not any pawns - out of my pocket, to place
> somewhere on the chessboard by the winner, in two of the squares. Then
> the blindfold is removed and the winner will look at the chessboard and
> counts the number of different moves he can make with the chess pieces
> from the squares that they are in. The winner will get as many gold
> coins from me as that count is. If I know in advance which two pieces
> will be given to the winner, I need to know how many gold coins I should
> bring with me to the party, so I could never find myself with not enough
> coins to give to the winner, and never carry with me even one gold coin
> that would never be needed to be given to the winner. Find how many
> coins I should bring with me to the party."

Looks like for the sub-"code monkeys" a bit of more explanation is due.

Holaku will give one gold coin for every different first move that the
winner can make on the board.

Example. If the two pieces happen to be two bishops, and if the
blindfolded winner happened to place one at the first square on the left
of the bottom row, and the other on the last square on the far right of
the bottom row, then winner will get 14 gold coins.

Re: A Problem To Solve :-)

<BtYvN.258793$Ama9.10754@fx12.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9216&group=comp.os.linux.advocacy#9216

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!news.swapon.de!news.in-chemnitz.de!3.eu.feeder.erje.net!1.as.feeder.erje.net!feeder.erje.net!npeer.as286.net!npeer-ng0.as286.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
Subject: Re: A Problem To Solve :-)
Newsgroups: comp.os.linux.advocacy
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org> <uppf2e$1bq1i$1@solani.org>
Content-Language: en-US
From: nospam@dfs.com (DFS)
In-Reply-To: <uppf2e$1bq1i$1@solani.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 80
Message-ID: <BtYvN.258793$Ama9.10754@fx12.iad>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Mon, 05 Feb 2024 03:20:01 UTC
Organization: blocknews - www.blocknews.net
Date: Sun, 4 Feb 2024 22:20:02 -0500
X-Received-Bytes: 4639
 by: DFS - Mon, 5 Feb 2024 03:20 UTC

On 2/4/2024 8:53 PM, Physfitfreak wrote:
> On 2/3/2024 4:00 AM, Physfitfreak wrote:
>> "In each of my parties, a session is always included in which a
>> chessboard is placed on the floor, with no chess pieces on it. There
>> is a contest, and the winner is blindfolded and given two random chess
>> pieces of same color - but not any pawns - out of my pocket, to place
>> somewhere on the chessboard by the winner, in two of the squares. Then
>> the blindfold is removed and the winner will look at the chessboard
>> and counts the number of different moves he can make with the chess
>> pieces from the squares that they are in. The winner will get as many
>> gold coins from me as that count is. If I know in advance which two
>> pieces will be given to the winner, I need to know how many gold coins
>> I should bring with me to the party, so I could never find myself with
>> not enough coins to give to the winner, and never carry with me even
>> one gold coin that would never be needed to be given to the winner.
>> Find how many coins I should bring with me to the party."
>
>
> Looks like for the sub-"code monkeys" a bit of more explanation is due.
>
> Holaku will give one gold coin for every different first move that the
> winner can make on the board.
>
> Example. If the two pieces happen to be two bishops, and if the
> blindfolded winner happened to place one at the first square on the left
> of the bottom row, and the other on the last square on the far right of
> the bottom row, then winner will get 14 gold coins.

Ho Lee Fuk!

Are you now saying the challenge is to determine the max squares 2
random chess pieces can possibly cover with one move each, from any
random starting position? Is that it? Is that clear to you?

The original problem said "count the number of different moves he can
make". No mention of how many squares the move could cover. A rook in
the bottom right corner can make 2 moves (left and forward), but a rook
in the middle of the board can make 4 moves (left right forward backward).

Back to your example: What if one bishop is moved 1 square, and the
other is moved 3 squares? Those are valid moves, worth 4 gold coins.
In your scenario, does that count? Or does the move have to cover the
max squares available, given the starting position?

Also: a bishop in one corner and a queen in the far corner (both on the
same diagonal). If the queen moves first - off the diagonal - the
bishop can then cover 7 squares max. But if the bishop moves first,
he's blocked by the queen and can cover a max of only 6 squares. How is
such blocking to be addressed? Should the code solution maximize the
total squares by moving the blocking piece first?

Also:

* "the winner is blindfolded and given two random chess pieces
of same color"

* "If I know in advance which two pieces will be given to the winner"

If he's given random pieces, you can't know in advances which pieces
will be given. These contradictions make the setup even more confusing.

I told you you didn't even know what you were asking.

But if I'm finally grasping the challenge as I restated it, it's very
interesting and probably doable without too much trouble. Being
optimistic. So my plan would be to conceive of the board as a 2-d array
with locations (0,0) to (7,7), pick 2 random pieces, place them randomly
on the board, and try to maximize the available squares for each piece
to move, considering the starting position and behavior of each piece.
And the aforementioned blocking is an issue that has to be considered.

I'm getting a little ahead of myself.

Where's the original problem? Point us to that, so nothing gets lost in
chimp-babble translation.

Re: A Problem To Solve :-)

<upptbh$1c2oi$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9222&group=comp.os.linux.advocacy#9222

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy
Subject: Re: A Problem To Solve :-)
Date: Sun, 4 Feb 2024 23:57:04 -0600
Message-ID: <upptbh$1c2oi$1@solani.org>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org> <uppf2e$1bq1i$1@solani.org>
<BtYvN.258793$Ama9.10754@fx12.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 5 Feb 2024 05:57:05 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1444626"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:mkbQQ7n3eN83TbJ5rXCAW8+A3B8=
Content-Language: en-US
In-Reply-To: <BtYvN.258793$Ama9.10754@fx12.iad>
X-User-ID: eJwNwoERwCAIBLCVEPgXximC+49gL4Fx8Wwn6Li/o1esHI4MkVvUDkgo166epHU2wkdG4VoqNCx2cLZ+KQ8ovBQZ
 by: Physfitfreak - Mon, 5 Feb 2024 05:57 UTC

On 2/4/2024 9:20 PM, DFS wrote:
> On 2/4/2024 8:53 PM, Physfitfreak wrote:
>> On 2/3/2024 4:00 AM, Physfitfreak wrote:
>>> "In each of my parties, a session is always included in which a
>>> chessboard is placed on the floor, with no chess pieces on it. There
>>> is a contest, and the winner is blindfolded and given two random
>>> chess pieces of same color - but not any pawns - out of my pocket, to
>>> place somewhere on the chessboard by the winner, in two of the
>>> squares. Then the blindfold is removed and the winner will look at
>>> the chessboard and counts the number of different moves he can make
>>> with the chess pieces from the squares that they are in. The winner
>>> will get as many gold coins from me as that count is. If I know in
>>> advance which two pieces will be given to the winner, I need to know
>>> how many gold coins I should bring with me to the party, so I could
>>> never find myself with not enough coins to give to the winner, and
>>> never carry with me even one gold coin that would never be needed to
>>> be given to the winner. Find how many coins I should bring with me to
>>> the party."
>>
>>
>> Looks like for the sub-"code monkeys" a bit of more explanation is due.
>>
>> Holaku will give one gold coin for every different first move that the
>> winner can make on the board.
>>
>> Example. If the two pieces happen to be two bishops, and if the
>> blindfolded winner happened to place one at the first square on the
>> left of the bottom row, and the other on the last square on the far
>> right of the bottom row, then winner will get 14 gold coins.
>
>
> Ho Lee Fuk!
>
> Are you now saying the challenge is to determine the max squares 2
> random chess pieces can possibly cover with one move each, from any
> random starting position?  Is that it?  Is that clear to you?
>
> The original problem said "count the number of different moves he can
> make".  No mention of how many squares the move could cover.  A rook in
> the bottom right corner can make 2 moves (left and forward), but a rook
> in the middle of the board can make 4 moves (left right forward backward).
>
> Back to your example: What if one bishop is moved 1 square, and the
> other is moved 3 squares?  Those are valid moves, worth 4 gold coins. In
> your scenario, does that count?  Or does the move have to cover the max
> squares available, given the starting position?
>
> Also: a bishop in one corner and a queen in the far corner (both on the
> same diagonal).  If the queen moves first - off the diagonal - the
> bishop can then cover 7 squares max.  But if the bishop moves first,
> he's blocked by the queen and can cover a max of only 6 squares.  How is
> such blocking to be addressed?  Should the code solution maximize the
> total squares by moving the blocking piece first?
>
>
> Also:
>
> * "the winner is blindfolded and given two random chess pieces
>    of same color"
>
> * "If I know in advance which two pieces will be given to the winner"
>
> If he's given random pieces, you can't know in advances which pieces
> will be given.  These contradictions make the setup even more confusing.
>
>
> I told you you didn't even know what you were asking.
>
> But if I'm finally grasping the challenge as I restated it, it's very
> interesting and probably doable without too much trouble.  Being
> optimistic.  So my plan would be to conceive of the board as a 2-d array
> with locations (0,0) to (7,7), pick 2 random pieces, place them randomly
> on the board, and try to maximize the available squares for each piece
> to move, considering the starting position and behavior of each piece.
> And the aforementioned blocking is an issue that has to be considered.
>
> I'm getting a little ahead of myself.
>
> Where's the original problem?  Point us to that, so nothing gets lost in
> chimp-babble translation.
>
>

You're really stupid. And not even a code monkey. A cro-magnon. It's
occasions like this that points to your species itself.

Re: A Problem To Solve :-)

<upq42l$1c60v$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9223&group=comp.os.linux.advocacy#9223

  copy link   Newsgroups: comp.os.linux.advocacy sci.physics
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy,sci.physics
Subject: Re: A Problem To Solve :-)
Date: Mon, 5 Feb 2024 01:51:49 -0600
Message-ID: <upq42l$1c60v$1@solani.org>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 5 Feb 2024 07:51:49 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1447967"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:nbcAARXyd1eKGZecYf70PG0Oslo=
In-Reply-To: <upl2ru$19kpu$1@solani.org>
Content-Language: en-US
X-User-ID: eJwNykEBACAIA8BKoAMkDqLrH0HvfTZdvQNuDqNxK3syJHNYLE0cysjJhSD8+J91k6pyiPLqTLH+xyo27n4+vBVJ
 by: Physfitfreak - Mon, 5 Feb 2024 07:51 UTC

On 2/3/2024 4:00 AM, Physfitfreak wrote:
> Ghotbeddin:
>
>    "Your Majesty's wish will undoubtedly get fulfilled."
>
>

The rest of the story:

Ghotbeddin forgot that a daughter of Holaku even exists, and immediately
went home to work on the problem. Got his chessboard and placed it down
on the floor, on top of the fine Persian carpet woven in that same area,
according to Azarbayjan's styles which both colorwise and patterns were
distinct in Iran. He placed two same color pieces on the board and began
thinking...

Worked on it all night. By morning, his hopes of giving the tabulated
answers to Holaku on that morning had disappeared into thin air. It
would take some time to finish this job! So he went to bed tired and
beaten, and soon fell asleep. But shortly after he felt unusually cold.
Opened his eyes and found himself in his sleeping bag at the top of the
magic mountain!

Still remembering the dream, he stretched his hand into his backpack and
pulled out his Aspire One mini laptop dedicated to DOS, with qbasic on
it, prepared hot water to make tea, and as he gave out a good voluminous
fart he loudly said, "To you Pope The Penis X!" Then began coding the
now simple and totally under control problem. He got the answers,
tabulated them nicely, then hoped he would travel back to 13th century
next time he went to sleep, to give the table to Holaku Khan, and see
the beautiful daughter.

Re: A Problem To Solve :-)

<a3fdc789-3310-4364-9c96-7f34469ae062n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9224&group=comp.os.linux.advocacy#9224

  copy link   Newsgroups: comp.os.linux.advocacy
X-Received: by 2002:ac8:7c43:0:b0:42c:1764:2dd1 with SMTP id o3-20020ac87c43000000b0042c17642dd1mr561886qtv.2.1707134796426;
Mon, 05 Feb 2024 04:06:36 -0800 (PST)
X-Received: by 2002:a05:622a:164d:b0:42c:28ba:f5e2 with SMTP id
y13-20020a05622a164d00b0042c28baf5e2mr86350qtj.10.1707134796240; Mon, 05 Feb
2024 04:06:36 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.linux.advocacy
Date: Mon, 5 Feb 2024 04:06:36 -0800 (PST)
In-Reply-To: <gqQvN.46602$mMj7.42181@fx01.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=67.149.153.65; posting-account=VHdvsQoAAAB0SHzFot62NmvVr15syA7-
NNTP-Posting-Host: 67.149.153.65
References: <uog01l$mi9n$1@solani.org> <17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org> <17ae82c70ea94150$228$649016$802601b3@news.usenetexpress.com>
<up6lc5$11v29$3@solani.org> <17aec41c90182031$280$639368$802601b3@news.usenetexpress.com>
<SqzuN.308058$c3Ea.149625@fx10.iad> <upeld4$162cu$2@solani.org>
<%yEvN.299033$7sbb.177002@fx16.iad> <gqQvN.46602$mMj7.42181@fx01.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a3fdc789-3310-4364-9c96-7f34469ae062n@googlegroups.com>
Subject: Re: A Problem To Solve :-)
From: lordiemassa@gmail.com (Lord Master)
Injection-Date: Mon, 05 Feb 2024 12:06:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2400
 by: Lord Master - Mon, 5 Feb 2024 12:06 UTC

On Sunday, February 4, 2024 at 1:10:24 PM UTC-5, DFS wrote:

> sprintf(nbrstr,"%d%d%d", i,j,k);
> nbr = atoi(nbrstr);
>

Oh my fucking god! The incompetent code monkey strikes again!

Look at this piece of shit. The dumbfuck converts integers to a string and
then converts the string back into an integer! This is the pinnacle of
programming idiocy!

Just do:

int num = 100*i + 10*j + k;

>
> prod = i*j*k;
> div = (double)nbr / (double)prod;
> if (nbr % prod == 0) {
> if (div >= 1 && div <= 31) {
>

Then the retard casts integers to doubles (!!!) to perform divison!!!

A competent programmer just performs integer division directly:

div_t q = div(num, i*j*k);
if(q.rem == 0) { ... }

Get this supreme idiot out of here!

A "code monkey" is too good of a term for this infinite retard.

Re: A Problem To Solve :-)

<9g7wN.397628$p%Mb.228002@fx15.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9229&group=comp.os.linux.advocacy#9229

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
From: nospam@dfs.com (DFS)
Subject: Re: A Problem To Solve :-)
Newsgroups: comp.os.linux.advocacy
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<17ae82c70ea94150$228$649016$802601b3@news.usenetexpress.com>
<up6lc5$11v29$3@solani.org>
<17aec41c90182031$280$639368$802601b3@news.usenetexpress.com>
<SqzuN.308058$c3Ea.149625@fx10.iad> <upeld4$162cu$2@solani.org>
<%yEvN.299033$7sbb.177002@fx16.iad> <gqQvN.46602$mMj7.42181@fx01.iad>
<a3fdc789-3310-4364-9c96-7f34469ae062n@googlegroups.com>
Content-Language: en-US
In-Reply-To: <a3fdc789-3310-4364-9c96-7f34469ae062n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 17
Message-ID: <9g7wN.397628$p%Mb.228002@fx15.iad>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Mon, 05 Feb 2024 15:36:37 UTC
Organization: blocknews - www.blocknews.net
Date: Mon, 5 Feb 2024 10:36:40 -0500
X-Received-Bytes: 1539
 by: DFS - Mon, 5 Feb 2024 15:36 UTC

On 2/5/2024 7:06 AM, Lameass Larry Piet Master wrote:

> A "code monkey" is too good of a term for this infinite retard.

Feeb: I used a small C program to "brute force" the solution.

DFS : Where's your original code?

Feeb: Give me a minute. Mine was shit, so I'm busy copying ideas from
yours.

And that is a FACT. And that's why you'll NEVER post your original code.

Re: A Problem To Solve :-)

<uprqki$1d2oc$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9234&group=comp.os.linux.advocacy#9234

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!news.chmurka.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy
Subject: Re: A Problem To Solve :-)
Date: Mon, 5 Feb 2024 17:22:58 -0600
Message-ID: <uprqki$1d2oc$1@solani.org>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<17ae82c70ea94150$228$649016$802601b3@news.usenetexpress.com>
<up6lc5$11v29$3@solani.org>
<17aec41c90182031$280$639368$802601b3@news.usenetexpress.com>
<SqzuN.308058$c3Ea.149625@fx10.iad> <upeld4$162cu$2@solani.org>
<%yEvN.299033$7sbb.177002@fx16.iad> <gqQvN.46602$mMj7.42181@fx01.iad>
<a3fdc789-3310-4364-9c96-7f34469ae062n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 5 Feb 2024 23:22:58 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1477388"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JQCKrbvSEDM0toKSS1Wk43BRdTY=
Content-Language: en-US
X-User-ID: eJwFwQkBwDAIA0BLfIEhB9rGv4TdwVPzVCQyQHAxJ3kLo06Pl/yqCym72U7cocxzMzpEhW29j67XTqAWP2ADFZY=
In-Reply-To: <a3fdc789-3310-4364-9c96-7f34469ae062n@googlegroups.com>
 by: Physfitfreak - Mon, 5 Feb 2024 23:22 UTC

On 2/5/2024 6:06 AM, Lord Master wrote:
> A "code monkey" is too good of a term for this infinite retard.

Ditto.

A code monkey at least understands what the chessboard problem is
asking. And can carefully proceed to code it. He isn't there yet. It
gets him confused.

Re: A Problem To Solve :-)

<PbewN.54194$Iswd.37220@fx05.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9235&group=comp.os.linux.advocacy#9235

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx05.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
From: nospam@dfs.com (DFS)
Subject: Re: A Problem To Solve :-)
Newsgroups: comp.os.linux.advocacy
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org> <uppf2e$1bq1i$1@solani.org>
<BtYvN.258793$Ama9.10754@fx12.iad> <upptbh$1c2oi$1@solani.org>
Content-Language: en-US
In-Reply-To: <upptbh$1c2oi$1@solani.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 203
Message-ID: <PbewN.54194$Iswd.37220@fx05.iad>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Mon, 05 Feb 2024 23:29:51 UTC
Organization: blocknews - www.blocknews.net
Date: Mon, 5 Feb 2024 18:29:51 -0500
X-Received-Bytes: 6520
 by: DFS - Mon, 5 Feb 2024 23:29 UTC

On 2/5/2024 12:57 AM, Physfitfreak wrote:

> You're really stupid. And not even a code monkey. A cro-magnon. It's
> occasions like this that points to your species itself.

Here chimpy chimpy! Got a treat for you.

=======================================================================
//this progam determines the max number of squares 2 random non-pawn
chess pieces can
//possibly cover with one move each, from any random starting position.
Code assumes
//one piece cannot block the other.

//This code is hereby donated to the public domain

//usage:
//$ ./prog <leave blank and system will generate 2 random pieces>
// or
//$ ./prog <piece1> <piece2> no brackets
//$ ./prog Qe6 Ka1

//pieces and starting position must be entered using standard
// chess algebraic notation: Ba3 Kg1 Ne8 etc
//pieces : K king, Q queen, R rook, B bishop, N knight
//columns: abcdefgh
//rows : 1-8

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>

//K king, Q queen, R rook, B bishop, N knight
char *pieces[] = {"K","Q","R","B","N"};
char *pieceslong[] = {"King","Queen","Rook","Bishop","Knight"};

//build random piece and starting position
//column,row is converted to algebraic notation
char *genpiece(char newpiece[]) {
char piece[2], col[2];
sprintf(piece,"%s",pieces[rand() % 5]);
sprintf(col,"%c",(rand() % 8) + 97);
int row = (rand() % 8) + 1;
sprintf(newpiece,"%s%s%d",piece,col,row);
}

//find largest value
int getmax(int a, int b, int c, int d) {
int max = 0;
if (a > max) {max = a;}
if (b > max) {max = b;}
if (c > max) {max = c;}
if (d > max) {max = d;}
return max;
}

//find smallest value
int getmin(int a, int b, int c, int d) {
int min = 9;
if (a < min) {min = a;}
if (b < min) {min = b;}
if (c < min) {min = c;}
if (d < min) {min = d;}
return min;
}

// determine max number of squares that can be moved from the starting
position
int calcsquares(char piece[], char endpos[]) {

//min and max square moves by piece
//king 1,1
//queen 1,7
//rook 1,7
//bishop 1,7
//knight 3,3

int squares = 0;

//convert algebraic notation to col,row
//a1 = col 1,row 1 white, bottom left
//h8 = col 8,row 8 black, top right
int pcol = piece[1]-96;
int prow = atoi(&piece[2]);

//kings and knights will always be able to move 1 and 3 squares
//respectively, no matter the starting position
if (piece[0] == 'K') { squares += 1; }
if (piece[0] == 'N') { squares += 3; }

//left and right edges of board are 1 and 8
//bottom and top of board are 1 and 8

//rooks move on rows or columns
//queens move anywhere, but diagonal moves can never exceed the
// number of spaces available on rows and columns
//evaluate 4 move directions: left, right, forward, backward
int l=0,r=0,f=0,b=0;
if (piece[0] == 'R' || piece[0] == 'Q') {
l = pcol - 1;
r = 8 - pcol;
f = 8 - prow;
b = prow - 1;
squares += getmax(l,r,f,b);
//printf("%s: left %d, right %d, fwd %d, bwd %d
max=%d\n",piece,l,r,f,b,getmax(l,r,f,b));
}

//bishops move on diagonals (down left, down right, up left, up
right)
//https://www.geeksforgeeks.org/count-the-total-number-of-squares-that-can-be-visited-by-bishop-in-one-move/
//99 and -99 are used just to send 4 args to the functions
int dl=0, dr=0, ul=0, ur=0;
if (piece[0] == 'B') {
dl = 8 - getmax(prow, 9-pcol, -99, -99);
dr = getmin(prow, 9-pcol, 99, 99) -1;
ul = getmin(prow, pcol, 99, 99) - 1;
ur = 8 - getmax(prow, pcol, -99, -99);
squares += getmax(dl,dr,ul,ur);
//printf("%s: down left %d, down right %d, up left %d, up right %d
max=%d\n",piece,dl,dr,ul,ur,getmax(dl,dr,ul,ur));
}

return squares;

}

int main(int argc, char *argv[]) {
//TODO maybe:
// 1. handle piece blocking
// 2. allow 3+ pieces using an array
// 3. capture and display ending position

//random
srand(time(NULL));

//pieces
char p1[4], p2[4];

//no input from user, so system generates 2 random pieces
if (argc == 1)
{ genpiece(p1);
genpiece(p2);
while (strcmp(p1,p2)==0) { genpiece(p2); } //ensure 2 different
pieces
}

//invalid entry
if ((argc == 2) || (argc > 3))
{ printf("Enter 2 valid pieces\n");
exit(0);
}
//user inputs
if (argc == 3)
{ sprintf(p1,"%s",argv[1]);
sprintf(p2,"%s",argv[2]);
if (strcmp(p1,p2)==0)
{ printf("You entered 2 of the same piece \n");
exit(0);
}
}

//pieces and algebraic notation must be len(3)
if (strlen(p1)!=3 || strlen(p2)!=3)
{ printf("Enter 2 valid pieces\n");
exit(0);
}

//calc max squares moved per piece
int p1squares = calcsquares(p1);
int p2squares = calcsquares(p2);

//summary of squares moved
printf("\n");
printf(" Max\n");
printf("Start Squares\n");
printf("---------------\n");
printf("%-5s %d\n", p1,p1squares);
printf("%-5s %d\n", p2,p2squares);
printf("---------------\n");
printf("Total %d\n", p1squares + p2squares);
printf("---------------\n\n");

return(0);
} ====================================================================

Not well-tested. Free banana and back-shave if you find a calculation
bug. It will allow some bad input, so watch your paws.

All code freshly written except bishop/diagonal formulas from website.

Re: A Problem To Solve :-)

<NiewN.54195$Iswd.40483@fx05.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9236&group=comp.os.linux.advocacy#9236

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx05.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
Subject: Re: A Problem To Solve :-)
Newsgroups: comp.os.linux.advocacy
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org> <uppf2e$1bq1i$1@solani.org>
<BtYvN.258793$Ama9.10754@fx12.iad> <upptbh$1c2oi$1@solani.org>
<PbewN.54194$Iswd.37220@fx05.iad>
Content-Language: en-US
From: nospam@dfs.com (DFS)
In-Reply-To: <PbewN.54194$Iswd.37220@fx05.iad>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 17
Message-ID: <NiewN.54195$Iswd.40483@fx05.iad>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Mon, 05 Feb 2024 23:37:17 UTC
Organization: blocknews - www.blocknews.net
Date: Mon, 5 Feb 2024 18:37:17 -0500
X-Received-Bytes: 1396
 by: DFS - Mon, 5 Feb 2024 23:37 UTC

On 2/5/2024 6:29 PM, DFS wrote:
> On 2/5/2024 12:57 AM, Physfitfreak wrote:
>
>> You're really stupid. And not even a code monkey. A cro-magnon. It's
>> occasions like this that points to your species itself.
>
> Here chimpy chimpy!  Got a treat for you.

bug!

replace line 62
int calcsquares(char piece[], char endpos[]) {

with
int calcsquares(char piece[]) {

Re: A Problem To Solve :-)

<uprv26$1d50k$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9237&group=comp.os.linux.advocacy#9237

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy
Subject: Re: A Problem To Solve :-)
Date: Mon, 5 Feb 2024 18:38:30 -0600
Message-ID: <uprv26$1d50k$1@solani.org>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org> <uppf2e$1bq1i$1@solani.org>
<BtYvN.258793$Ama9.10754@fx12.iad> <upptbh$1c2oi$1@solani.org>
<PbewN.54194$Iswd.37220@fx05.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 6 Feb 2024 00:38:30 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1479700"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:r6cCJHFa8NuZ19str156w2i5odw=
X-User-ID: eJwFwQkBACAIBLBK8p0QBwT6R3AzAeFdhUFtbQua73Zx0NkuVYoXUtVaMr48VKM4uu3okpy8fjc4mb0P/ANzlBYk
Content-Language: en-US
In-Reply-To: <PbewN.54194$Iswd.37220@fx05.iad>
 by: Physfitfreak - Tue, 6 Feb 2024 00:38 UTC

On 2/5/2024 5:29 PM, DFS wrote:
> //$ ./prog <leave blank and system will generate 2 random pieces>

You have not understood the problem.

Re: A Problem To Solve :-)

<uprv8a$1d50k$2@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9238&group=comp.os.linux.advocacy#9238

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy
Subject: Re: A Problem To Solve :-)
Date: Mon, 5 Feb 2024 18:41:46 -0600
Message-ID: <uprv8a$1d50k$2@solani.org>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org> <uppf2e$1bq1i$1@solani.org>
<BtYvN.258793$Ama9.10754@fx12.iad> <upptbh$1c2oi$1@solani.org>
<PbewN.54194$Iswd.37220@fx05.iad> <NiewN.54195$Iswd.40483@fx05.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 6 Feb 2024 00:41:46 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1479700"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:KhS4b6rkcb8qb/3akF5S5p2RrDM=
X-User-ID: eJwNyrEBACEIBLCVkOMQxkF59h/hbVKF8OV3m9ONw4Ee3xezYpAClpe3LgYQNegX7ZGidltNmqOnKlKSe/j9L+YUqA==
Content-Language: en-US
In-Reply-To: <NiewN.54195$Iswd.40483@fx05.iad>
 by: Physfitfreak - Tue, 6 Feb 2024 00:41 UTC

On 2/5/2024 5:37 PM, DFS wrote:
> On 2/5/2024 6:29 PM, DFS wrote:
>> On 2/5/2024 12:57 AM, Physfitfreak wrote:
>>
>>> You're really stupid. And not even a code monkey. A cro-magnon. It's
>>> occasions like this that points to your species itself.
>>
>> Here chimpy chimpy!  Got a treat for you.
>
> bug!
>
> replace line 62
> int calcsquares(char piece[], char endpos[]) {
>
> with
> int calcsquares(char piece[]) {
>
>

I don't think you have understood the problem.

If you think you have, then in your own words state the problem.

Re: A Problem To Solve :-)

<ups2ld$1d50k$3@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9239&group=comp.os.linux.advocacy#9239

  copy link   Newsgroups: comp.os.linux.advocacy sci.physics
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy,sci.physics
Subject: Re: A Problem To Solve :-)
Date: Mon, 5 Feb 2024 19:39:57 -0600
Message-ID: <ups2ld$1d50k$3@solani.org>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org> <upq42l$1c60v$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 6 Feb 2024 01:39:57 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1479700"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:u7Fr6YzUyowQm8sWpirc8mIxXuc=
X-User-ID: eJwFwQkBwDAIA0BLQPgqh5bFv4TdBVLzlWekB4MoijQEwYFnn0V88EkZbb1qZbZsaO/QGb13X9XZElqM/ijlFM8=
Content-Language: en-US
In-Reply-To: <upq42l$1c60v$1@solani.org>
 by: Physfitfreak - Tue, 6 Feb 2024 01:39 UTC

On 2/5/2024 1:51 AM, Physfitfreak wrote:
> On 2/3/2024 4:00 AM, Physfitfreak wrote:
>> Ghotbeddin:
>>
>>     "Your Majesty's wish will undoubtedly get fulfilled."
>>
>>
>
>
> The rest of the story:
>
> Ghotbeddin forgot that a daughter of Holaku even exists, and immediately
> went home to work on the problem. Got his chessboard and placed it down
> on the floor, on top of the fine Persian carpet woven in that same area,
> according to Azarbayjan's styles which both colorwise and patterns were
> distinct in Iran. He placed two same color pieces on the board and began
> thinking...
>
> Worked on it all night. By morning, his hopes of giving the tabulated
> answers to Holaku on that morning had disappeared into thin air. It
> would take some time to finish this job! So he went to bed tired and
> beaten, and soon fell asleep. But shortly after he felt unusually cold.
> Opened his eyes and found himself in his sleeping bag at the top of the
> magic mountain!
>
> Still remembering the dream, he stretched his hand into his backpack and
> pulled out his Aspire One mini laptop dedicated to DOS, with qbasic on
> it, prepared hot water to make tea, and as he gave out a good voluminous
> fart he loudly said, "To you Pope The Penis X!" Then began coding the
> now simple and totally under control problem. He got the answers,
> tabulated them nicely, then hoped he would travel back to 13th century
> next time he went to sleep, to give the table to Holaku Khan, and see
> the beautiful daughter.
>
>
>
>
>
>

So the story continues...

Days came and passed. None of the night sleeps resulted in a dream to
take him to the 13th century with the now ready table. So at night, when
warming himself with a little fire and getting ready to go to his
sleeping bag, he thought to himself, "If I don't travel back to Maragheh
observatory tonight, I'll just burn the one page table in the fire and
forget about it."

The night became morning, and Physfit still in his sleeping bag openned
his eyes and realized something was not right. There were clouds above
him! "At this altitude?..." he asked himself. He turned his head left
and found he was looking at urban areas of Dallas, with the Reunion
Tower over there standing by downtown! Turned his head right and saw
that he was lying down in his sleeping bag at the top of a 100 yard
mountain, with his house in the view, within a short walking distance!
He quickly, before anything get changed again, got up and put on his
mountain shoes and dress, and got ready to climb down fast before the
mountain gets bigger again.

By the time he reached the ground level, it was 4:45 pm and the sun was
setting, and in another 15 minutes he was home, at his computer, going
through the news.

He read somewhere that at least half of the Americans' missiles to hit
Houthi targets would only hit the adjacent areas, not the targets
themselves, but each time Houthis lauched a missile, it came down dead
correct and hit the target. Physfit wondered about it for a few moments.

There were a few related news pieces as well. In one of them, from a
Pakestani press outlet, they explained in detail how the missiles
automatically calculated the coordinates of the target. A reconnaissance
drone beforehand would get near enough to target to see it, then using
laser would fly on a straightline towards the target and record its own
coordinates at two different points on that straight line.

Then using such information, back home, the distance of the target to
the missiles launching site would accurately get calculated. Then they'd
launch the missiles.

Everything calculated were in two dimensions only. Just height and the
distance.

If the drone calculated coordinates of the two points on that line of
sight as (x_1, y_1) and (x_2, y_2), with x being the distance and y the
height, then the distance of the target to launch area would have any of
the two forms below:

x . y - x . y
1 2 2 1
x = -----------------
y - y
2 1

or:

/x - x \ . y
\ 2 1/ 1
x = x - --------------
1 y - y
2 1

And the Americans in charge being cro-magnons (and Nazi), seeing that
one of the above formulas can be derived from the other one, were
assuming it didn't matter which one to use for calculating x-intercept
for their missiles to hit Houthis targets. But Houthis, being Modern
Humans, always chose one of the above, and never the other.

So Physfit found out why about half of American missiles narrowly miss
their targets, while Houthis missiles always hit the targets.

1- Verify that the two formulas are correct, and algebraically related.

2- Assuming the drone calculated (x_1, y_1) as (1.31, 4.76) kilometers,
and (x_2, y_2) as (1.93, 3.24) kilometers, and assuming that for
shortest computation time, numbers are rounded to three digits in the
codes imbedded in drones and missiles, then calculate the x-intercept in
both ways.

3- Explain which of the two methods is being used by the Houthis, and why.

Re: A Problem To Solve :-)

<TzgwN.298224$Wp_8.39947@fx17.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9240&group=comp.os.linux.advocacy#9240

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!rocksolid2!news.neodome.net!weretis.net!feeder8.news.weretis.net!npeer.as286.net!npeer-ng0.as286.net!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
From: nospam@dfs.com (DFS)
Subject: Re: A Problem To Solve :-)
Newsgroups: comp.os.linux.advocacy
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org> <uppf2e$1bq1i$1@solani.org>
<BtYvN.258793$Ama9.10754@fx12.iad> <upptbh$1c2oi$1@solani.org>
<PbewN.54194$Iswd.37220@fx05.iad> <NiewN.54195$Iswd.40483@fx05.iad>
<uprv8a$1d50k$2@solani.org>
Content-Language: en-US
In-Reply-To: <uprv8a$1d50k$2@solani.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 66
Message-ID: <TzgwN.298224$Wp_8.39947@fx17.iad>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Tue, 06 Feb 2024 02:12:03 UTC
Organization: blocknews - www.blocknews.net
Date: Mon, 5 Feb 2024 21:12:04 -0500
X-Received-Bytes: 2728
 by: DFS - Tue, 6 Feb 2024 02:12 UTC

On 2/5/2024 7:41 PM, Physfitfreak wrote:
> On 2/5/2024 5:37 PM, DFS wrote:
>> On 2/5/2024 6:29 PM, DFS wrote:
>>> On 2/5/2024 12:57 AM, Physfitfreak wrote:
>>>
>>>> You're really stupid. And not even a code monkey. A cro-magnon. It's
>>>> occasions like this that points to your species itself.
>>>
>>> Here chimpy chimpy!  Got a treat for you.
>>
>> bug!
>>
>> replace line 62
>> int calcsquares(char piece[], char endpos[]) {
>>
>> with
>> int calcsquares(char piece[]) {
>>
>>
>
>
> I don't think you have understood the problem.
>
> If you think you have, then in your own words state the problem.

The very first comment line explains what the code does:

"this progam determines the max number of squares 2 random non-pawn
chess pieces can possibly cover with one move each, from any random
starting position. Code assumes one piece cannot block the other."

Which is based on what your example says it should do:

"Example. If the two pieces happen to be two bishops, and if the
blindfolded winner happened to place one at the first square on the left
of the bottom row, and the other on the last square on the far right of
the bottom row, then winner will get 14 gold coins."

Try it:

$ ./program Ba1 Bh1

Max
Start Squares
---------------
Ba1 7
Bh1 7
---------------
Total 14
---------------

* you have to enter the pieces using standard chess algebraic notation.

* if you don't enter anything, the program generates 2 random pieces.

Either way, it calculates the max squares each piece can move one time
(assuming no blocking).

Re: A Problem To Solve :-)

<ups5io$1d50k$4@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9241&group=comp.os.linux.advocacy#9241

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy
Subject: Re: A Problem To Solve :-)
Date: Mon, 5 Feb 2024 20:29:44 -0600
Message-ID: <ups5io$1d50k$4@solani.org>
References: <uog01l$mi9n$1@solani.org>
<17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>
<uohk04$ndab$2@solani.org> <up4385$11vs3$1@solani.org>
<upl2ru$19kpu$1@solani.org> <uppf2e$1bq1i$1@solani.org>
<BtYvN.258793$Ama9.10754@fx12.iad> <upptbh$1c2oi$1@solani.org>
<PbewN.54194$Iswd.37220@fx05.iad> <NiewN.54195$Iswd.40483@fx05.iad>
<uprv8a$1d50k$2@solani.org> <TzgwN.298224$Wp_8.39947@fx17.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 6 Feb 2024 02:29:44 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1479700"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:NEP4jVmFK0H6XW8Jay+PLqllCSw=
In-Reply-To: <TzgwN.298224$Wp_8.39947@fx17.iad>
Content-Language: en-US
X-User-ID: eJwFwYEBwCAIA7CXQGgd54jY/09YgqDz7iSYEMRbPc1lLin6xkzlsABzjoxZ+9gqC+vIzxaj+6Soi+d4P1ayFVo=
 by: Physfitfreak - Tue, 6 Feb 2024 02:29 UTC

On 2/5/2024 8:12 PM, DFS wrote:
> On 2/5/2024 7:41 PM, Physfitfreak wrote:
>> On 2/5/2024 5:37 PM, DFS wrote:
>>> On 2/5/2024 6:29 PM, DFS wrote:
>>>> On 2/5/2024 12:57 AM, Physfitfreak wrote:
>>>>
>>>>> You're really stupid. And not even a code monkey. A cro-magnon.
>>>>> It's occasions like this that points to your species itself.
>>>>
>>>> Here chimpy chimpy!  Got a treat for you.
>>>
>>> bug!
>>>
>>> replace line 62
>>> int calcsquares(char piece[], char endpos[]) {
>>>
>>> with
>>> int calcsquares(char piece[]) {
>>>
>>>
>>
>>
>> I don't think you have understood the problem.
>>
>> If you think you have, then in your own words state the problem.
>
>
> The very first comment line explains what the code does:
>
> "this progam determines the max number of squares 2 random non-pawn
> chess pieces can possibly cover with one move each, from any random
> starting position. Code assumes one piece cannot block the other."
>
>
> Which is based on what your example says it should do:
>
> "Example. If the two pieces happen to be two bishops, and if the
> blindfolded winner happened to place one at the first square on the left
> of the bottom row, and the other on the last square on the far right of
> the bottom row, then winner will get 14 gold coins."
>
>
> Try it:
>
> $ ./program Ba1 Bh1
>
>          Max
> Start   Squares
> ---------------
> Ba1        7
> Bh1        7
> ---------------
> Total      14
> ---------------
>
>
>
> * you have to enter the pieces using standard chess algebraic notation.
>
> * if you don't enter anything, the program generates 2 random pieces.
>
> Either way, it calculates the max squares each piece can move one time
> (assuming no blocking).
>
>
>
>

No.

You must understand the problem first. Any code monkey has good reading
comprehension, otherwise they're just useless cause they won't know what
it is that the employer wants them to do.


computers / comp.os.linux.advocacy / Re: A Problem To Solve :-)

Pages:12345678910
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor