1. This module works now.
- Posted by Alan Tu <ATU5713 at COMPUSERVE.COM> May 27, 1998
- 638 views
Bonn and Pete, I have the following code. I fixed the problem and instated my real purpose. This module works as intended. include input.e clear_screen() sequence prompt atom i prompt =3D {97,98,99,100,101,102,103,104,105,106,107,108} for prompt_loop =3D 1 to 12 do i =3D input("Enter " & prompt[prompt_loop] & ": ") puts(1,"\n") end for --Alan =
2. Re: This module works now.
- Posted by "Graeme." <hmi at POWERUP.COM.AU> May 28, 1998
- 636 views
At 07:40 PM 5/27/98 -0400, you wrote: >include input.e >clear_screen() >sequence prompt >atom i >prompt = {97,98,99,100,101,102,103,104,105,106,107,108} >for prompt_loop = 1 to 12 do >i = input("Enter " & prompt[prompt_loop] & ": ") >puts(1,"\n") >end for > >--Alan Have you considered: for prompt_loop=97 to 108 do i=input("Enter "&prompt_loop&": ") puts(1,"\n") end for Storing consecutive numbers in a sequence isn't really nesessary. Graeme. ----------------------------------------------------
3. Re: This module works now.
- Posted by Alan Tu <ATU5713 at COMPUSERVE.COM> May 27, 1998
- 626 views
- Last edited May 28, 1998
Dear Graeme, Your code from the last reply is so much cleaner. I'll make some changes= =2E --Alan =
4. Re: This module works now.
- Posted by Irv <irv at ELLIJAY.COM> May 27, 1998
- 693 views
- Last edited May 28, 1998
Here's my version: Hope there are no typos (those formulas boggle the eyes) -----33matrix.ex----- include input.e constant prompt = "abcdefghijkl" sequence v, sav v = repeat(0,12) atom a,b,c,d,e,f,g,h,i,j,k,l, M,N,O,P clear_screen() for x = 1 to length(prompt) do v[x] = input("Enter a value for " & prompt[x] & " \n") end for sav = v -- save the numbers for use later: -- convert to atoms so your formulas will still work: a = v[1] b = v[2] c = v[3] d = v[4] e = v[5] f = v[6] g = v[7] h = v[8] i = v[9] j = v[10] k = v[11] l = v[12] M = a*e*i-a*f*h+b*f*g-b*d*i+c*d*h-c*e*g a = j d = k g = l N = a*e*i-a*f*h+b*f*g-b*d*i+c*d*h-c*e*g a = sav[1] d = sav[4] g = sav[7] b = j e = k h = l O = a*e*i-a*f*h+b*f*g-b*d*i+c*d*h-c*e*g b = sav[8] e = sav[5] h = sav[8] c = j f = k i = l P = a*e*i-a*f*h+b*f*g-b*d*i+c*d*h-c*e*g printf(1,"Your answers are: %f %f %f", { N/M, O/M, P/M })