Re:

by Ben (no login)

Usually when I see a homework question with stupid stuff like files, spreadsheets, dollars, net pay, balance, etc. I ignore them. But after rereading your assignment, it kind of makes sense, so I will help you. Seeing that you posted some good time ago, you are probably already screwed, but whatever.

( Also, I suggest not to use statements (RANDOMIZE maybe?) that you were not taught in your class, or try doing things a better or alternative way, because teachers don't like that. )

Not sure what you mean by $10 range to +10$. Anyways, I think you made a mistake with your array(i,j)= because it gives me negative numbers. This might work better:

array(i,j) = int(rnd(1)*89)+10

which will make a number between 10, and 99 but i maybe wrong. Modify as you need.

Since you need to take a number from user 10 times, you'll need a main loop that reapeats for 10 times:

for k=1 to 10
'your code here
next

You are going to need to properly display data, and input a number from a user.

dim n as integer
INPUT n

to properly display data, you might do something like this:

for i=1 to 10
for j=1 to 10
if array(i,j)=picked(i,j) then ? array(i,j); else ? space$(4);
next
?
next

notice how I used PRINT with semicolons instead of LOCATE? I'll leave that to you to degrade it for locate statements.

( And by the way, space$(4) is the same as 4 spaces in between the "" quotes, but this forum does not properly display more then one space, so i used space$(4) )

you will also have to see if what the user chose exists in the array. This can be done with a simple if statement which I'll leave to you to figure out.

Now that you have done your work, and your program is great, I'll show you what I have:

Note that it displays the full grid at the beginnig, for testing purposes, you should remove it to get the game experience. And:

"permitted to play again if he/she desires. "
"Do not permit a user to select a cell more than once per game."
I have not implemented.


[Homework Policy - Edited Out Actual Program]





    
This message has been edited by The-Universe on Apr 29, 2009 8:36 PM

Posted on Apr 29, 2009, 4:25 PM

Respond to this message   

Goto Forum Home


Response TitleAuthor and Date
I think it's supposed to give negative numbersPharoah on Apr 29
 I seeBen on Apr 29
  Ben you are supplying code to a person that has not even tried that hard. on Apr 29
   If they really don't care....Ben on Apr 30
    I wish my school had home ecPharoah on Apr 30
    Oh, they care! But they just want to have somebody else do it. on Apr 30
Re: Teachers on May 2