From: Matthew Kerwin Date: 2013-01-25T14:15:09+09:00 Subject: Re: General Ruby syntax questions --047d7b33d19ad704f304d41602e8 Content-Type: text/plain; charset=ISO-8859-1 On 25 January 2013 14:57, Scott Price wrote: > Thanks Matthew. I have one single question about the first section of > code. I know it returns the base raised to the exponent, but what does > the variable "i" stand for? I probably sound stupid asking these things, > but I have basically no experience coding. I just played with c++ for a > little while. I was never good. By convention, in most programming contexts, 'i' is often to count iterations of a loop. for (i = 0; i < number_of_iterations; i++) ... is pretty ubiquitous. In a nested loop, usually the inner loop uses 'j', and then 'k', etc. -- Matthew Kerwin, B.Sc (CompSci) (Hons) http://matthew.kerwin.net.au/ ABN: 59-013-727-651 "You'll never find a programming language that frees you from the burden of clarifying your ideas." - xkcd --047d7b33d19ad704f304d41602e8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On 25 January 2013 14:57, Scott Price &l= t;lists@ruby-foru= m.com> wrote:
Thanks Matthew. I have one single question a= bout the first section of
code. I know it returns the base raised to the exponent, but what does
the variable "i" stand for? I probably sound stupid asking these = things,
but I have basically no experience coding. I just played with c++ for a
little while. I was never good.
=A0
By con= vention, in most programming contexts, 'i' is often to count iterat= ions of a loop.

=A0 =A0 for (i =3D 0; = i < number_of_iterations; i++)

... is pretty ubiquitous. =A0In a nested loop, usually the inner loop uses= 'j', and then 'k', etc.

--
=A0 Mat= thew Kerwin, B.Sc (CompSci) (Hons)
=A0 http://matt= hew.kerwin.net.au/
=A0 ABN: 59-013-727-651

=A0 "You'= ll never find a programming language that frees
=A0 you from the burden = of clarifying your ideas." - xkcd
--047d7b33d19ad704f304d41602e8--