Deutsch English Français Italiano |
<03fcd46b8d44390c78ca1719e2311b528570d276.camel@gmail.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: wij <wyniijj5@gmail.com> Newsgroups: comp.lang.c++ Subject: Re: Is this program OOP? Date: Tue, 10 Dec 2024 17:23:23 +0800 Organization: A noiseless patient Spider Lines: 66 Message-ID: <03fcd46b8d44390c78ca1719e2311b528570d276.camel@gmail.com> References: <63cd41709a703e4ac6d76427d53fe06d7ee8b8b1.camel@gmail.com> <86plm0iwtj.fsf@linuxsc.com> <035b9e2186f9dc6467806e27a76d98525c104e54.camel@gmail.com> <86h67chxn8.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Date: Tue, 10 Dec 2024 10:23:24 +0100 (CET) Injection-Info: dont-email.me; posting-host="0ba521b8ff24999df21a7b0e42ad0dc0"; logging-data="958941"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+WvliJJeCEUbW4YI4rZHsu" User-Agent: Evolution 3.50.2 (3.50.2-1.fc39) Cancel-Lock: sha1:sa27q75/kHofLuiO3cKdJcq/zfU= In-Reply-To: <86h67chxn8.fsf@linuxsc.com> Bytes: 3671 On Mon, 2024-12-09 at 22:15 -0800, Tim Rentsch wrote: > wij <wyniijj5@gmail.com> writes: >=20 > > On Mon, 2024-12-09 at 09:35 -0800, Tim Rentsch wrote: > >=20 > > > wij <wyniijj5@gmail.com> writes: > > >=20 > > > > Because I said:=C2=A0 C++ is the best language to model general > > > > problems.=C2=A0 So it is. > > > >=20 > > > > Almost all are logical propositions.=C2=A0 Except those few keyword= s, > > > > such programwon't be recognized as a C++ program, instead of some > > > > kind of declarative language. > > > >=20 > > > > Zebra puzzle is an interesting programing exercise because it is > > > > not too easy and also not too difficult. > > > >=20 > > > > ------------ > > > > /* Copyright is licensed by GNU LGPL, see file COPYING. by I.J.Wang= 2023 > > > >=20 > > > > =C2=A0Example of solving the zebra puzzle by using propositional lo= gic. > > > > =C2=A0Zebra Puzzle https://en.wikipedia.org/wiki/Zebra_Puzzle > > > >=20 > > > > [...] > > > > */ > > > > #include <Wy.stdio.h> > > > > #include <Sc/PropExpr.h> > > > >=20 > > > > using namespace Wy; > > > > using namespace Sc; > > > >=20 > > > > [...] > > >=20 > > > You're asking a question that cannot be answered because much or > > > most of the program is in the two include files, which are not > > > shown. > > >=20 > > > As a general rule, when posting code there should be enough posted > > > so that readers can at least compile it.=C2=A0 In cases like the prog= ram > > > asked about here, what is posted should be enough to both compile > > > the program and run the generated executable. > >=20 > > I thought nobody will be interested with the implement, and what > > is shown should be enough for the moment. >=20 > The point is that what was posted is not enough to answer the > question of the Subject: line. >=20 > > The Zebra Puzzle program has two version, a_puzzle_21.cpp (has > > shown) takes too long to complete.=C2=A0 a_puzzle_2.cpp (736 lines, too > > long to post, I thought) is the realistic one written in way I > > feel just solving the prolem is enough. >=20 > I wrote a program in prolog to solve this puzzle.=C2=A0 The entire > program is 60 lines long, including 13 blank lines.=C2=A0 It finds > the solution in 0.03 seconds.=C2=A0 The program doesn't do anything > fancy;=C2=A0 it pretty much just gives the listed conditions in the form > of prolog rules, plus 20 lines to establish the structure of the > information that is being sought. Very dubious, show us what you say is true.