Baru saja saya telah menerima beberapa permintaan bantuan dengan teknik Delphi beberapa yang tidak terlalu sulit setelah Anda melakukan satu. Recently I've received several requests for help with a few Delphi techniques that are not too difficult once you do one. Berikut adalah penawaran saat ini: Here are the current offerings:
![]() | Manipulasi gambar (Parking Lot) - cara menggambar gambar dan merespon klik pada kontrol TImage. Image manipulation (Parking Lot) - how to draw a picture and respond to clicks on a TImage control. |
![]() | TChart - grafik fungsi atau data lainnya dengan melewatkan array nilai. TChart - graphing a function or other data by passing an array of values. |
![]() | Demo Backtracking menggambarkan pencarian Depth-first untuk path melalui array memenuhi kondisi tertentu. BackTracking Demo illustrates a Depth-first search for a path through an array meeting certain conditions. |
![]() | DrawDice DrawDice menarik gambar dadu acak. draws random dice images. |
![]() | CountWords menghitung kata dalam teks masukan. CountWords counts words in input text. |
![]() | Ekspresi 864 menemukan semua permutasi yang jumlah ke nilai yang diberikan dan menggunakan semua 1-9 digit tepat satu kali dalam persamaan. Expressions 864 finds all permutations which sum to a given value and use all digits 1-9 exactly once in the equation. |
![]() | Allwords menampilkan semua permutasi huruf atau kata-kata yang valid hanya dari himpunan huruf. Allwords displays all letter permutations or valid words only from a given set of letters. |
![]() | MemLeakDemo menggambarkan bahaya mengalokasikan dan tidak membebaskan memori, dan bagaimana untuk mengetahui apakah itu terjadi .. MemLeakDemo illustrates the hazards of allocating and not freeing memory, and how to tell if it is happening.. |
![]() | Menggambar Lingkaran Olimpiade menunjukkan bagaimana menggunakan "elips" dan "busur" prosedur untuk menarik gambar logo Cincin Olimpiade. Draw Olympic Rings shows how to use "ellipse" and "arc" procedures to draw an image of the Olympic Rings logo. |
![]() | Decrypt Sederhana mengimplementasikan cipher pergeseran kuno, "Caesar Cipher" untuk encode atau memecahkan kode pesan teks. Simple Decrypt implements an ancient shift cipher, "Caesar's Cipher" to encode or decode text messages. |
![]() | Jumlah yang Digit menghitung jumlah bilangan bulat panjang yang diberikan digit jumlah untuk setiap nilai yang diberikan. Digit Sums counts the number of integers of given length whose digits sum to any given value. |
![]() | Kata Terbalik menggunakan fungsi dan komponen ReverseString kamus TDict kami untuk menemukan kata-kata yang valid yang surat-suratnya dibalik dalam baris tertentu teks. Reversed Words uses the ReverseString function and our TDict dictionary component to find valid words whose letters are reversed in given lines of text. |
![]() | 3N + 1 mengeksplorasi "Dugaan Collatz" bahwa urutan dibentuk oleh dua aturan sederhana selalu merosot nilai 1. 3N + 1 explores the "Collatz Conjecture" that a sequence formed by two simple rules always degenerates the value 1. |
![]() | Kamar mandi Eksekutif menemukan 3 integer ganjil digit tanpa angka berulang (kombinasi rahasia untuk J kamar mandi eksekutif). Executive bathroom finds 3 digit odd integers with no repeated digits (the secret combination for the executive bathroom J ). |
![]() | Twofers (Dua untuk harga satu): Dua pertanyaan masalah sederhana masing-masing dengan tepat dua solusi. Twofers (Two for the price of one): Two simple problem questions each with exactly two solutions. |
![]() | Produk Digit : Mensa Puzzle lain-A-Day puzzle kalender, sedikit diperpanjang sini. Digit Products : another Mensa Puzzle-A-Day calendar puzzle, slightly extended here. |
![]() | Pecking Orde : Menggunakan "Mod" operator untuk membantu memecahkan teka-teki puitis yang juga bisa diselesaikan dengan aljabar tua polos jika Anda bekerja hati-hati. Pecking Order : Uses the "Mod" operator to help solve a poetic puzzle which could also be solved by plain old algebra if you work carefully. |
![]() | Squared Catur Pieces : Program lain baris 35 memecahkan teka-teki yang mungkin sangat sulit tanpa komputer! Squared Chess Pieces : Another 35 line program solving a puzzle which might be very hard without a computer! |
Gulir ke bawah untuk melihat seluruh penawaran. Scroll down to see all offerings.
Manipulasi Gambar (Lot Parkir) Image Manipulation (Parking Lot)

Klik disini untuk mendownload Parkir Lot kode sumber Simulasi Click here to download Parking Lot Simulation source code

TChartDemo1 dan TChartDemo2 TChartDemo1 and TChartDemo2

Addendum 2 Desember 2005: Sebuah penampil baru ini bertanya tentang mendapatkan data masukan pengguna dari kotak daftar atau memo ke grafik. Addendum December 2, 2005: A viewer recently asked about getting user input data from a list box or memo into a chart. Berikut TChartDemo2 yang menunjukkan teknik beberapa tambahan untuk data pengguna charting. Here's TChartDemo2 which shows a few additional techniques for charting user data. Ini termasuk "hilang" fungsi Delphi, StrToFloatDef. It includes a "missing" Delphi function, StrToFloatDef . yang mencoba untuk mengubah string input untuk angka floating point dan mengembalikan baik nilai numerik dari string atau nilai default jika input string tidak mewakili angka yang benar. which tries to convert an input string to a floating point number and returns either the numeric value of the string or a default value if the input string does not represent a valid number.
Klik disini untuk mendownload TChart kode Demo sumber Click here to download TChart Demos source code

Backtracking BackTracking

Klik disini untuk mendownload Backtracking kode Demo sumber Click here to download Backtracking Demo source code

DrawDice (8 Juni 2005) DrawDice (June 8, 2005)

Klik disini untuk mendownload sumber DrawDice Click Here to download DrawDice source
CountWords (8 Juni 2005) CountWords (June 8, 2005)
Bagaimana Anda menghitung kata dalam sebuah dokumen teks? How do you count words in a text document? Seperti mencintai landak - sangat hati-hati. Like loving a porcupine - very carefully. Inilah awal sederhana meskipun, dengan rutinitas Getword yang terlihat untuk satu set standar pembatas menandai ujung kata-kata. Here's simple start though, with a Getword routine which looks for a predefined set of delimiters marking the ends of words. Kata-kata dari file teks yang diambil dan terdaftar. Words from a text file are extracted and listed. Ada juga tombol Ringkaskan yang terakumulasi jumlah kejadian demi kata. There is also a Summarize button that accumulates number of occurrences by word.Klik di sini untuk men-download kode sumber CountWords. Click here to download CountWords source code.

Expressions864 (8 Juni 2005) Expressions864 (June 8, 2005)
Temukan semua solusi di mana jumlah dari dua nomor sama dengan 864. Find all solutions where the sum of two numbers equals 864. Dan omong-omong, yang And by the way, thesolusi, termasuk jumlah "864" harus berisi semua angka 1 sampai 9 persis solution, including the "864" sum must contain all of the digits 1 through 9 exactly
sekali. once. Lain jumlah untuk mencoba: 594, 783, 675, 927. Other sums to try: 594, 783, 675, 927. Anda juga dapat memeriksa Brute Force untuk pendekatan lain modus umum untuk memecahkan masalah. You can also check Brute Force for another mode generalized approach to solving the problem. Expressions864.prb sekarang termasuk di antara masalah sampel. Expressions864.prb is now included among the sample problems.
Klik disini untuk mendownload Expressions864 kode sumber. Click here to download Expressions864 source code.

Allwords (30 September 2005) Allwords (September 30, 2005)
Mengingat string surat, menemukan semua himpunan bagian yang mungkin dari huruf ("kata") yang dapat dibentuk. Given a letter string, find all possible subsets of letters ("words") that can be formed. Opsional, daftar kata-kata saja yang dapat divalidasi terhadap kamus yang diberikan. Optionally, list only words that can validated against a given dictionary. Kode ini cukup sederhana karena menggunakan dua lainnya pre-built unit sebagai penolong "alat" UComboV2 berisi kelas yang menghasilkan permutasi yang membantu kita membentuk kata-kata.. UDict berisi kelas kamus yang memungkinkan kami memvalidasi kata percobaan kami. This code is fairly simple because it uses two other pre-built units as helper "tools". UComboV2 contains the class which generates the permutations which help us form the words. UDict contains the dictionary class that lets us validate our trial words.Klik di sini untuk men-download sumber AllWords Click here to download AllWords source
Klik di sini untuk men-download executable AllWords Click here to download AllWords executable

MemLeakDemo MemLeakDemo
Meskipun penggunaan catatan dan petunjuk kurang kritis hari ini daripada di pra-objek hari, beberapa sekolah masih mengajarkan penggunaannya. Even though the use of records and pointers is less critical today than in the pre-object days, some schools still teach their use. Dan penggunaan pointer record di bidang objek TStringlists kadang-kadang nyaman. And the use of record pointers in the objects field of TStringlists is sometimes convenient.Aturan utamanya ketika mengalokasikan memori dalam program Anda adalah untuk memastikan bahwa itu akan dirilis. The cardinal rule when allocating memory within your program is to make sure that it gets released. Salah satu cara umum untuk membuat kebocoran memori adalah untuk mengalokasikan record menggunakan fungsi baru dan tidak melepaskan memori (menggunakan Dispose). One common way to create a memory leak is to allocate a record using the New function and not releasing the memory (using Dispose ).
Siswa kadang-kadang bingung dengan fakta bahwa variabel lokal dalam fungsi dan prosedur secara otomatis dirilis oleh Delphi ketika Anda keluar dari rutinitas. Students are sometimes confused by the fact that local variables within functions and procedure are automatically released by Delphi when you exit the routine. Hal ini berlaku untuk semua memori bahwa Delphi dialokasikan atas nama Anda, tapi tidak ke memori Anda dialokasikan. This applies to all of the memory that Delphi allocated on your behalf, but not to the memory you allocated. Jika Anda memiliki variabel lokal, P, dan mengeksekusi Baru (P) dalam rutinitas, Delphi akan menghapus 4 byte yang ditempati oleh P, tetapi tidak memori bahwa P poin untuk! If you have local variable, P, and execute New(P) within the routine, Delphi will delete the 4 bytes occupied by P, but not the memory that P points to! Dan jika tidak dihapus sebelum Anda keluar, memori yang akan tetap dialokasikan sampai program berakhir. And if not deleted before you exit, that memory will remain allocated until the program ends.
Berikut adalah program yang mengalokasikan 1000 byte catatan dalam sebuah prosedur dengan dan tanpa melepaskan mereka hanya untuk menggambarkan masalah. Here's a program that allocates 1000 byte records within a procedure with and without releasing them just to illustrate the problem. Ia menggunakan variabel global AllocMemSize untuk menunjukkan penggunaan memori meningkat sebagai program berjalan. It uses the AllocMemSize global variable to show increasing memory usage as the program runs.
Klik di sini untuk men-download sumber MemLeakDemo Click here to download MemLeakDemo source

Gambarlah Olimpiade Rings (February 15, 2006) Draw Olympic Rings (February 15, 2006)

Klik disini untuk download Menggambar sumber Olimpiade Rings Click here to download Draw Olympic Rings source
Klik disini untuk mendownload Gambar Olimpiade dieksekusi Rings Click here to download Draw Olympic Rings executable

Kami memiliki program dekripsi tempat lain di DFF yang memeriksa semua cipher substitusi mungkin dan memeriksa hasil terhadap sebuah kamus untuk menentukan keberhasilan. We have a decryption program elsewhere at DFF which checks all possible substitution ciphers and check results against a dictionary to determine success. Masalahnya, pendekatan ini dapat berjalan selama berjam-jam, dan jika teks berisi kata-kata tidak ada dalam kamus, mungkin tidak berhasil sama sekali. The problem is, this approach can run for hours, and if the text contains words not in the dictionary, may not succeed at all. Saya Mensa "Puzzle-A-Day" kalender berkala berisi pesan dienkripsi dengan "cipher pergeseran" sederhana, juga dikenal sebagai "Caesar Cipher" karena Julius Caesar menggunakannya untuk mengenkripsi pesan pada zaman Romawi kuno. My Mensa "Puzzle-A-Day" calendar periodically contains messages encrypted with a simple "shift cipher", also known as the "Caesar Cipher" because Julius Caesar used it to encrypt message in ancient Roman times. Dalam cipher pergeseran, setiap huruf digantikan dengan huruf agak jauh tetap jauh di normal "abcd ..." In the shift cipher, each letter is replaced by a letter at some fixed distance away in the normal "abcd..." daftar surat. listing of letters. Sebagai contoh, jika semua teks biasa "a" digantikan oleh "c" s, kemudian "b" s, menjadi "d" s, menjadi "c" s "e" s dll untuk menghasilkan teks terenkripsi. For example, if all plain text "a"s were replaced by "c"s, then "b"s, becomes "d"s, "c"s becomes "e"s etc. to produce the encrypted text.
Kurang dari 40 baris yang ditulis pengguna Delphi kode untuk memindai baris teks input menggunakan semua 25 pilihan enkripsi mungkin (26 jika Anda menghitung satu yang memetakan setiap huruf kembali sendiri). It takes less than 40 lines of user written Delphi code to scan lines of input text using all 25 possible encryption choices (26 if you count the one that maps each letter back to itself). Anda memberikan cek kamus pemindaian output untuk menentukan mana yang benar. You provide the dictionary check scanning the outputs to determine which one is correct. Dan, tentu saja itu akan mengenkripsi sebaik akan mendekripsi! And, of course it will encrypt as well as it will decrypt!
Klik di sini untuk men-download sumber Sederhana Decrypt Click here to download Simple Decrypt source
Klik di sini untuk men-download executable Sederhana Decrypt Click here to download Simple Decrypt executable

Sebuah kalender Mensa teka-teki terakhir bertanya "Berapa banyak 4 digit angka yang ada yang jumlah digit menjadi 34?" A recent Mensa puzzle calendar asked "How many 4 digit numbers are there whose digits sum to 34?" Yang itu tidak terlalu sulit karena jumlah yang tidak dapat melebihi 36 (untuk integer 9999), tetapi mulai saya berpikir tentang jumlah lain. That one is not too difficult since the sum cannot exceed 36 (for the integer 9999), but it started me thinking about other sums. Ini jumlah program dan daftar jumlah bilangan bulat panjang yang diberikan untuk jumlah nilai apapun. This program counts and lists the number of integers of given length which sum to any value. Sekitar 25 baris yang ditulis pengguna Delphi kode menjawab pertanyaan selama dua sampai lima digit bilangan bulat. About 25 lines of user written Delphi code answer the question for two through five digit integers.
Untuk programer, kode akan menjelaskan cara mengekstrak digit individu dari integer. For programmers, the code will clarify how to extract individual digits from an integer. Juga, setelah baris terakhir ditambahkan pada memo tampilan output, bagaimana untuk memaksa kembali baris atas ke tampilan. Also, after the last line is added to the output display memo, how to force the top line back into view.
Klik di sini untuk men-download sumber Digit Jumlah yang Click here to download Digit Sums source
Klik di sini untuk men-download executable Digit Jumlah yang Click here to download Digit Sums executable

Sebanyak 25 program baris dari halaman teka-teki kalender terakhir Mensa. Another 25 line program from a recent Mensa calendar puzzle page. Kita diminta untuk menemukan kata 7-surat yang muncul terbalik di baris teks dan yang memenuhi definisi yang diberikan. We are asked to find a 7-letter word which appears reversed in text lines and which meet a given definition. Itu pasti lebih menyenangkan untuk menulis sebuah program dari secara manual mencari teks bagi kata itu. It was surely more fun to write a program than to manually search the text for the word. Saya membagi masalah menjadi dua bagian: I divided the problem into two parts:
- Daftar 7-string surat surat dibalik yang akan menentukan kandidat solusi. Find all 7-letter reversed letter strings which will define the solution candidates. Menambahkan StrUtils untuk klausa Penggunaan memberi kita akses ke fungsi ReverseString sehingga kami bisa membalikkan properti Text seluruh keluar TMemo masukan, kemudian hapus spasi, tanda baca dan Kembali Carriage / linefeed karakter yang menandai akhir-line untuk baris di TMemo . Adding StrUtils to the Uses clause gives us access to the ReverseString function so we can reverse the entire Text property of out input TMemo , then remove spaces, punctuation and the Carriage Return/LineFeed characters which mark end-of-line for lines in the TMemo. Akhirnya, langkah meskipun string memetik dari 7 karakter pada satu waktu dari setiap posisi awal mungkin dan menyimpannya dalam sebuah TListBox. Finally, step though the string picking off 7 characters at a time from each possible starting position and saving them in a TListBox .
- Periksa string di kotak Daftar dari langkah sebelumnya menggunakan IsValidWord dan Lookup fungsi kelas kamus TDict kami untuk menemukan kombinasi yang adalah kata-kata yang valid. Check the strings in the List box from the previous step using the IsValidWord and Lookup function of our TDict dictionary class to find the combinations which are valid words. Kami akan menampilkan ini dalam kotak daftar kedua. We'll display these in a second list box. Untuk memudahkan penggunaan, saya telah menyertakan Full.dic kamus besar dalam file zip di bawah ini, Juga kamus unit, UDict, termasuk dalam file kode sumber zip. For ease of use, I have included the large dictionary Full.dic in the zip files below, Also dictionary unit, UDict , is included in the source code zip file. Versi terbaru dari UDict akan selalu tersedia di kami berkas Perpustakaan DFF dan kamus dari WordStuff halaman Latest version of UDict will always be available in our DFF Library file and the dictionaries from the WordStuff page
Klik di sini untuk men-download executable Terbalik Kata Click here to download Reversed Words executable

Ada website di http://uva.onlinejudge.org/~~V yang menyediakan pasokan hampir tak terbatas dari masalah pemrograman yang digunakan untuk melatih untuk Kontes Pemrograman ACM tahunan. There is a website at http://uva.onlinejudge.org/ which provides a virtually unlimited supply of programming problems used to train for annual ACM Programming Contests. Saya tidak menyukai kompetisi kuasi disediakan oleh fasilitas Scoring Online di situs untuk beberapa alasan; Free Pascal Pascal hanya keluarga bahasa yang didukung dan 2) program Anda dijalankan terhadap set diketahui input dan umpan balik tidak membantu di debug ("Jawaban yang salah"), meninggalkan satu untuk menebak tentang sifat dari masalah. I am not fond of the quasi competition provided by the Online Scoring facility at the site for a couple of reasons; Free Pascal is the only Pascal family language supported and 2) your program is run against an unknown set of inputs and feedback is not helpful in debugging ("Wrong answer"), leaving one to guess about the nature of the problem. Ini mensimulasikan lingkungan kontes, tetapi sebagai sarana belajar daun banyak yang harus diinginkan. This does simulate the contest environment, but as a learning tool leaves much to be desired. Masalah itu sendiri namun tampaknya dilakukan dengan baik dan memberikan banyak tantangan mental ketika mengembangkan dan menerapkan solusi. The problems themselves however seem to be well done and provide lots of mental challenges while developing and implementing solutions.
Masalah ini adalah yang pertama dalam serangkaian masalah. This problem is first in the set of problems. Ini adalah dugaan yang belum terbukti itu, menatap dengan bilangan bulat positif, urutan diperoleh dengan menerapkan aturan-aturan di bawah ini akan selalu merosot ke nilai akhir 1. It is an unproven conjecture that, staring with a positive integer, the sequence obtained by applying these rules below will always degenerate to a final value of 1. Aturan untuk menghasilkan entri i +1 adalah: Rules to generate entry i+1 are:
![]() | N i +1 = 3N i +1 jika N i adalah bahkan N i+1 = 3N i +1 if N i is even |
![]() | N i +1 = N i / 2 jika N i adalah bahkan. N i+1 = N i /2 if N i is even. |
Program ini memiliki sekitar 50 baris kode yang ditulis pengguna untuk mengumpulkan nilai-nilai input, mengevaluasi solusi, dan menampilkannya. This program has about 50 lines of user written code to collect the input values, evaluate the solution, and display it. Ada banyak ruang untuk mengeksplorasi di sini. There is lots of room to explore here. Sebagai contoh: For example:
![]() | Menampilkan siklus terpanjang ditemukan. Display the longest cycle found. |
![]() | Dimana N berkisar memiliki rasio Cycle_Length / N tertinggi? Which N in a range has the highest Cycle_Length/N ratio? |
![]() | Apakah siklus terpanjang di kisaran juga memiliki nilai maksimum tertinggi? Does the longest cycle in a range also have the highest maximum value? |
![]() | Jika kita mendefinisikan suatu "pembalikan" sebagai puncak atau lembah dalam urutan, berapa banyak yang ada? If we define a "reversal" as a peak or valley within the sequence, how many are there? Apakah urutan terpanjang memiliki pembalikan paling? Does the longest sequence have the most reversals? |
Klik disini untuk mendownload ThreeNPlus1 dieksekusi Click here to download ThreeNPlus1 executable

Kode entri untuk kamar mandi eksekutif adalah nomor tiga digit ganjil tanpa digit berulang. The entry code for the executive bathroom is a three-digit odd number with no repeated digits. Jika Anda ingin mencoba mendobrak masuk, apa jumlah maksimum Kode entri Anda harus mencoba? If you want to try to break in, what is the maximum number of entry codes you'll have to try? (Ingat bahwa tiga digit angka tidak boleh dimulai dengan nol.) Sumber: Puzzle Mensa Halaman-A-Day Calendar untuk April 12 Desember 2010. (Remember that three-digit numbers cannot start with zero.) Source: The Mensa Puzzle Page-A-Day Calendar for April 12, 2010.
Hanya membutuhkan waktu 15 baris kode untuk menentukan dan menampilkan jawabannya. It only takes 15 lines of code to determine and display the answer. Saya juga termasuk penjelasan Mensa Kalender sebagai sebuah memo tersembunyi yang akan terlihat setelah solusi program yang akan ditampilkan. I also included the Mensa Calendar explanation as a hidden memo that becomes visible after the program solution is displayed.
Klik di sini untuk men-download sumber Mandi Eksekutif Click here to download Executive Bathroom source
Klik di sini untuk men-download executable Mandi Eksekutif Click here to download Executive Bathroom executable

Dua masalah, masing-masing dengan tepat dua solusi. Two problems, each with exactly two solutions. Pemecahan setiap diperlukan hanya 10 sampai 15 baris kode. Solving each required only 10 to 15 lines of code. Berikut adalah pertanyaan: Here are the questions:
![]() | Hanya ada dua 2-digit Fahrenheit suhu (yaitu antara 10 dan 99) yang terbalik digit memberikan nilai celcius bulat setara. There are only two 2-digit Fahrenheit temperatures (ie between 10 and 99) whose reversed digits give the rounded equivalent Centigrade value. Apa itu? What are they? |
![]() | Apa dua pasang bilangan bulat positif, K dan M, memenuhi persamaan 13K + 41M = 1000? What two pairs of positive integers, K and M, satisfy the equation 13K + 41M = 1000? |
Klik di sini untuk men-download executable Twofers Click here to download Twofers executable

Kurang dari 20 baris kode ini memecahkan perpanjangan teka-teki Teka-teki-A-hari Kalender Mensa: Less than 20 lines of code solves this extension of a Mensa Puzzle-A-day Calendar puzzle:
Di antara 2 dan 3 digit bilangan bulat positif, ada satu atau dua yang sama dengan produk dari angka mereka untuk beberapa beberapa dari 2 sampai 9. Among the 2 and 3 digit positive integers, there are one or two which are equal to the product of their digits for some multiple from 2 through 9. Menemukan mereka. Find them.
Contoh: Untuk N = 24 Produk, P N = 8 dan untuk M = 3, kita memiliki N = M N * P. Example: For N=24, Product ,P N =8 and for M=3, we have N= M*P N .
April 29, 2011: Tiga masalah tambahan yang ditambahkan hari ini di Versi 2. April 29, 2011: Three additional problems were added today in Version 2. Ini adalah dari Teka-teki Matematika dan Logika untuk Penggemar PC These are from Math and Logic Puzzles for PC Enthusiasts
Klik di sini untuk men-download sumber DigitProducts Click here to download DigitProducts source
Klik di sini untuk men-download executable DigitProducts Click here to download DigitProducts executable

Masalah pertama selain saya yang terakhir ke perpustakaan saya, "permainan asah Matematika Menantang", adalah aljabar dan puitis pada saat yang sama: The first problem in my latest addition to my library, "Challenging Mathematical Teasers", is algebraic and poetic at the same time:
Pecking Orde Pecking Order
Empat burung pipit menemukan hidangan benih, Four sparrows found a dish of seed,
Burung baik makanan, tidak ada benih umum. Fine bird food, no common seed.
Kata Pip: "Pada gilirannya masing-masing mengambil 2 butir Said Pip: "In turn each take 2 grains
Dan kemudian sepertiga dari apa yang tersisa And then a third of what remains
Ini aku sebagai pertama, kemudian Pep, maka Pop, It's me as first, then Pep, then Pop,
Dengan Pap yang terakhir dan kemudian kita berhenti. " With Pap the last and then we stop."
Tapi Pap berseru: "Ini tidak adil. But Pap cried out: "It isn't fair.
Tambang itu dua biji kurang dari setengah pangsa Pep itu. " Mine's two seeds less than half Pep's share."
Pip tua itu bos, firman-Nya adalah hukum, Old Pip was boss, his word was law,
Jadi Pap sedikit mendapat tidak lebih. So little Pap got nothing more.
Pap miskin, bagiannya agak kecil! Poor Pap, his share was rather small!
Berapa banyak biji yang ada di semua? How many seeds were there in all?
Dari: "permainan asah Matematika Menantang", From: "Challenging Mathematical Teasers",
Gi JAH Hunter, Pub Dover, 1980 JAH Hunter, Dover Pubs, 1980
Burung baik makanan, tidak ada benih umum. Fine bird food, no common seed.
Kata Pip: "Pada gilirannya masing-masing mengambil 2 butir Said Pip: "In turn each take 2 grains
Dan kemudian sepertiga dari apa yang tersisa And then a third of what remains
Ini aku sebagai pertama, kemudian Pep, maka Pop, It's me as first, then Pep, then Pop,
Dengan Pap yang terakhir dan kemudian kita berhenti. " With Pap the last and then we stop."
Tapi Pap berseru: "Ini tidak adil. But Pap cried out: "It isn't fair.
Tambang itu dua biji kurang dari setengah pangsa Pep itu. " Mine's two seeds less than half Pep's share."
Pip tua itu bos, firman-Nya adalah hukum, Old Pip was boss, his word was law,
Jadi Pap sedikit mendapat tidak lebih. So little Pap got nothing more.
Pap miskin, bagiannya agak kecil! Poor Pap, his share was rather small!
Berapa banyak biji yang ada di semua? How many seeds were there in all?
Dari: "permainan asah Matematika Menantang", From: "Challenging Mathematical Teasers",
Gi JAH Hunter, Pub Dover, 1980 JAH Hunter, Dover Pubs, 1980
Mendefinisikan persamaan, mengganti, dan menghitung koefisien harus cukup untuk menyelesaikannya secara aljabar, tetapi satu slip akan mengarah ke jalan buntu. Defining the equations, substituting, and calculating the coefficients should be enough to solve it algebraically, but one slip will lead to a dead end. Ini "trial and error" program pemecah adalah cara yang lebih cepat dan lebih pasti untuk jawaban untuk saya. This "trial and error" solver program was quicker and surer way to the answer for me. Sekitar 30 baris kode menemukan jawaban dalam milidetik atau lebih. About 30 lines of code finds the answer in a millisecond or so.
Klik di sini untuk men-download executable urutan kekuasaan Click here to download Pecking Order executable 

Saya telah mengatakan bahwa menemukan solusi akan sangat sulit tanpa bantuan komputer tetapi solusi Dunn layak. I had said that finding the solution would be very hard without the help of a computer but Dunn's solution is feasible. Dengan menggunakan fakta bahwa akar kuadrat dari RAJA harus antara 32 dan 99 (karena persegi harus memiliki 4 digit) dan dengan memeriksa mereka semua, ia menemukan bahwa ada "hanya" 36 kotak yang berisi angka tidak ada duplikat. Using the fact that the square root of KING must be between 32 and 99 (because the square must have 4 digits) and by checking them all, she find that there are "only" 36 whose squares contain no duplicate digits. Memasukkan mereka ke dalam KNIGHT, kita bisa menemukan hanya satu nilai untuk G dan T yang membuat KNIGHT persegi sempurna. Plugging those into KNIGHT, we could find only one value for G and T which make KNIGHT a perfect square. Tidak, saya masih berpikir bahwa akan sangat sulit dan bahwa solusi line 35 saya adalah lebih cepat dan kurang membosankan! No, I still think that would be very hard and that my 35 line solution is quicker and less tedious!
Program ini akan memerlukan men-download file DFF Perpustakaan zip untuk mendapatkan akses ke UCombosV2, sebuah unit yang akan membiarkan dengan mudah menghasilkan dan menguji 151.000 cara untuk memilih 6 dari 10 digit untuk menemukan di antara mereka yang memberikan solusi. This program will require downloading the DFF Library zip file to gain access to UCombosV2, a unit that will let easily generate and test the 151,000 ways to select 6 of 10 digits to find which of them provides the solution.
Klik disini untuk mendownload Potongan sumber Catur Squared Click here to download Squared Chess Pieces source
Klik di sini untuk mendownload file zip DFF Perpustakaan terbaru ( Click here to download the latest DFF Library zip file ( DFFLibV13 DFFLibV13 ) )
Klik disini untuk mendownload Potongan dieksekusi Catur Squared Click here to download Squared Chess Pieces executable
Tidak ada komentar:
Posting Komentar