
-----------------------------------
weweii
Thu Jan 06, 2005 4:13 pm

need help in making snow with &quot;*&quot;
-----------------------------------
we have to do a winter scene, but i don't know how to do the snow with the " * ". 

Please help!!!!              anyone??

-----------------------------------
Cervantes
Thu Jan 06, 2005 4:31 pm


-----------------------------------
So, does that mean that you're making a snow scene using ASCII?  If so, locatexy might be of help.  So would an [url=http://www.compsci.ca/v2/viewtopic.php?t=1117]array or [url=http://www.compsci.ca/v2/viewtopic.php?t=366]two.

-----------------------------------
weweii
Thu Jan 06, 2005 6:43 pm


-----------------------------------
thank you for your solution! but i still don't really understand, can you please post the whole program here, so that i can see it?

thx alot!

-----------------------------------
Cervantes
Thu Jan 06, 2005 7:00 pm


-----------------------------------
can you please post the whole program here, so that i can see it?

No.  I won't do your homework for you.  Even if it's not homework and is purely for out-of-school-educational purposes, I still won't do it for you.  
I can, however, help you.  Tell me, do you understand arrays?  Are you adept at using for loops in conjunction with arrays?  Do you understand records?

-----------------------------------
weweii
Fri Jan 07, 2005 5:11 pm


-----------------------------------
can you please post the whole program here, so that i can see it?

No.  I won't do your homework for you.  Even if it's not homework and is purely for out-of-school-educational purposes, I still won't do it for you.  
I can, however, help you.  Tell me, do you understand arrays?  Are you adept at using for loops in conjunction with arrays?  Do you understand records?

i don't~~~  i just took computer science this year.. :oops:

-----------------------------------
Cervantes
Fri Jan 07, 2005 5:32 pm


-----------------------------------
Unless you can come up with a simpler way to portray the image of snow, using ASCII characters, I suggest you start reading up on arrays.  
There have been a few snow programs posted on compsci.ca, though they use graphics, not ASCII.  Using locatexy, (and some sorting to make it so that the characters on each line are drawn left to right, not in a random order), you could pretty easily transpose a graphics scene into an ASCII scene.  Try searching for them.

-----------------------------------
TheZsterBunny
Fri Jan 07, 2005 6:01 pm


-----------------------------------
weiwei,

by now, you should know the locate(x,y), put, and randint commands.

just use them creatively

randomly locate stars on the screen. its not that difficult. think!

-Z

-----------------------------------
weweii
Sat Jan 08, 2005 5:56 pm


-----------------------------------
hooray ! I got it!  but.. another problem came to me.... 
i already drawed the objects that will not be moving , but they are covered by the snow flakes scene. so i can only see the snowflakes with the blue background~~~ :cry: 
really appreciated for people who helped me and for people who will. :D

-----------------------------------
Cervantes
Sat Jan 08, 2005 6:21 pm


-----------------------------------

i already drawed the objects that will not be moving , but they are covered by the snow flakes scene. so i can only see the snowflakes with the blue background~~~ :cry: 

huh?  umm... are you drawing static objects with ASCII?  Or with graphics?  Either way, redraw them each time through the loop.

-----------------------------------
weweii
Sun Jan 09, 2005 5:25 pm


-----------------------------------
i think i 'll have to do it in ascii. but can someone please give me an example of randint?

-----------------------------------
Cervantes
Sun Jan 09, 2005 6:22 pm


-----------------------------------
That's up to Zster, because I'll be damned if snow moves randomly.

-----------------------------------
TheZsterBunny
Sun Jan 09, 2005 7:14 pm


-----------------------------------
lol


weiwei, you have ferrara as your compsci teacher?

coz then all you have to do is draw astericies ('*'s) randomly on the screen to simulate snow.

now, my personal favourite way to get random numbers is this.

x := Rand.Int(lo,hi)

the one you probably know is

randint(x,lo,hi)

and thats okay too. make sure that x is an integer tho'

I prefer the upper one because you don't necessairly need to keep a variable for that number, conveniant when you're only going to use it once.

-Z

-----------------------------------
weweii
Sun Jan 09, 2005 10:31 pm


-----------------------------------
finished!!!!  finally.......
thank you guys alot for helping me out on these "not-very-challenging" problems!

-----------------------------------
Hikaru79
Sun Jan 09, 2005 11:58 pm


-----------------------------------
finished!!!!  finally.......
thank you guys alot for helping me out on these "not-very-challenging" problems!

I think a lot of confusion was spawned by you saying "drawing snow with '*'", because it's an ASCII character, an operator (4 * 3) and a static value (myString (*-3)). I just hope we haven't led you to making an ASCII program when that's not what you intended ^ ^:;

-----------------------------------
TheZsterBunny
Mon Jan 10, 2005 8:22 pm


-----------------------------------
for the hell of it, here's some code.


colorback (blue)
cls
colorback (white)
loop
    colorback (white)
    locate (Rand.Int (1, maxrow), Rand.Int (1, maxcol))
    put "*" ..
    colorback (blue)
    locate (Rand.Int (1, maxrow), Rand.Int (1, maxcol))
    put " " ..
    exit when hasch
end loop



-Z

p.s. hikaru, your siggie is damaged. url tags out of whack. ^_^

-----------------------------------
Cervantes
Mon Jan 10, 2005 8:39 pm


-----------------------------------
Dammit Zster!  That's exactly what I'm talking about!  Snow isn't random!! Nor does that even look like snow!  Bah...

-----------------------------------
scottyrush13
Mon Jan 10, 2005 10:12 pm


-----------------------------------
im going to have to agree with cervantes here, that looks nothing like snow, because all the snow flakes should be moving in the same direction (because of wind), but puttin them random makes it look like theres 15 different wind directions because it looks like the snow is moving left and up and diagonal and everything :lol:

-----------------------------------
TheZsterBunny
Wed Jan 12, 2005 11:54 am


-----------------------------------
weiwei, i'm guessing, is in compsci 11 right now. we have projects coming up, and even tho compsci is the best 'use' of time out there we have science projects coming up.

-Z
