From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,224b101410a848a7,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.72.199 with SMTP id n7mr3633110qaj.5.1355959080910; Wed, 19 Dec 2012 15:18:00 -0800 (PST) Received: by 10.49.98.42 with SMTP id ef10mr1144549qeb.15.1355959080874; Wed, 19 Dec 2012 15:18:00 -0800 (PST) Path: k2ni865qap.0!nntp.google.com!ee4no758735qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 19 Dec 2012 15:18:00 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=93.129.178.198; posting-account=R80nsQoAAADNWKZhSnWyt-Rp7ZyxrQGD NNTP-Posting-Host: 93.129.178.198 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Ada Tutor: Outside Assignment 2 - Question to the Solution From: Cedric Injection-Date: Wed, 19 Dec 2012 23:18:00 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-12-19T15:18:00-08:00 List-Id: Hi All, I try to learn Ada using Ada Tutor (http://zhu-qy.blogspot.de/2012/08/adatutor.html). I tried the excerise of the outside assignment 2 and do not understand the given solution. The test driver says that the tests Compare( 2, 4, 6, Not_A_Triangle); Compare( 1, 3, 2, Not_A_Triangle); Compare( 3, 1, 2, Not_A_Triangle); Compare( 1, 2, 4, Not_A_Triangle); Compare( 1, 4, 2, Not_A_Triangle); Compare( 4, 1, 2, Not_A_Triangle); Compare( 3, 3, 7, Not_A_Triangle); Compare( 3, 7, 3, Not_A_Triangle); Compare( 6, 3, 3, Not_A_Triangle); do not define a valid triangle. The solution says if Len1 + Len2 <= Len3 or Len1 + Len3 <= Len2 or Len2 + Len3 <= Len1 then Answer := Not_A_Triangle; and You must have realized by now that it's impossible to draw a triangle with sides 1, 2, and 3. The sum of any two sides must be greater than the third. What is the exact mathematic definition of a triangle? My last math course a quick a while ago :( I would assume that a triangle formed by 1, 2 and 3 would give a valid triangle. Why should that not be the case? Regards Cedric