English
Source / code snippets

Bachet de Mezirac´s Balkenwaage

 

p.specht

Solution the Balkenwaagen-Problems (Wägung of 1 To 121 [pounds, kg, gram etc.] with possible little Gewichten)
Window Title "Bachet de Mezirac´s Wägeproblem"
cls:font 2
declare h&,  i&,j&,k&,l&,w&,sum&[121],konf$[121],max&

whileloop -1,1:h&=&Loop

    whileloop -1,1:i&=&Loop

        whileloop -1,1:j&=&Loop

            whileloop -1,1:k&=&Loop

                whileloop -1,1:l&=&Loop

                    w&=3^4*h&+3^3*i&+3^2*j&+3^1*k&+3^0*l&

                    if w&>=0':print w&

                        sum&[w&]=sum&[w&]+1
                        konf$[w&]=st$(int(3^4*h&))+" "+st$(int(3^3*i&))+" "+\
                        st$(int(3^2*j&))+" "+st$(int(3*k&))+" "+st$(int(l&))
                        case w&>max&:max&=w&

                    endif

                endwhile

            endwhile

        endwhile

    endwhile

endwhile

print "\n  Gewichtswert frequency  Konfiguration(´-´: In Wägegutschale)"

whileloop 0,max&

    print
    print tab(4);&Loop,tab(20);sum&[&Loop],tab(36);translate $(konf$[&Loop],"0",".",)

    if %csrlin>23:waitinput:cls:endif

        print

    endwhile

    print "\n ------------------------------------------------------"
    waitinput
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/30/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.409 Views

Untitledvor 0 min.
p.specht11/20/21
Uwe Lang11/20/21
Manfred Barei11/19/21
Wilfried Friebe11/17/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie