comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Ada95 Help 2D arrays
Date: Fri, 20 Apr 2012 19:27:32 +0300
Date: 2012-04-20T19:27:32+03:00	[thread overview]
Message-ID: <9vdh3kFu8rU1@mid.individual.net> (raw)
In-Reply-To: <31137140.191.1334922395977.JavaMail.geo-discussion-forums@ynjb15>

On 12-04-20 14:46 , Will wrote:
> I really need help with the problem below... any ideas?  I was
> thinking about passing each row and column into their own arrays or
> something but I am not even sure how to go about doing that.

Before trying to write the solution in Ada, perhaps you should write 
down the algorithm in English, and show it here on the newsgroup. We can 
then suggest how to express it in Ada.

> Many people across America participate in Superbowl pools. Your pool
> is run a little differently from most. Instead of buying individual
> squares from a grid, you purchase a row and a column. After
> painstaking research, you have assigned an integer score to each
> square representing the probability of that event occurring. You want
> to buy the row and column with the maximum combined score, calculated
> by adding all the individual scores in that row and column.

It is not clearly said here, but it seems that the element at the 
intersection of the row and column should be counted only *once* in the 
combined score of this (row,column) combination. Otherwise, you could 
pick the best row and the best column independently of each other.

> Write a function Best_Combined_Score(Grid) that takes an Int_Matrix

Is the type Int_Matrix already defined somewhere? That would be a 
starting point.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .



  reply	other threads:[~2012-04-20 16:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 11:46 Ada95 Help 2D arrays Will
2012-04-20 16:27 ` Niklas Holsti [this message]
2012-04-20 16:55 ` Will
2012-04-20 17:33 ` Will
2012-04-20 18:12   ` Niklas Holsti
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox