[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

an assignment for Gavino

hughaguilar96

6/17/2016 6:50:00 AM

Over on comp.lang.forth we had this thread:
https://groups.google.c...!topic/comp.lang.forth/qTDKxhW9758

I said this:

On Thursday, June 16, 2016 at 11:16:09 PM UTC-7, hughag...@gmail.com wrote:
> On Thursday, June 16, 2016 at 7:58:17 PM UTC-7, hughag...@gmail.com wrote:
> > On Wednesday, June 15, 2016 at 12:15:59 PM UTC-7, endlessboo...@gmail.com wrote:
> > > why?
> > Programming is about writing programs...
>
> Gavino --- I'm going to be like a teacher and give you an assignment! These are the rules of the assignment:
> 1.) Until you finish your assignment, you are not allowed to start any more of these idiotic threads on comp.lang.forth (or comp.lang.lisp etc.) --- if you do, you will just be reminded that you haven't finished your assignment.
> 2.) When you finish your assignment, I will put your program in the novice-package --- you will be famous! --- there is no better path to Forth fame than this!
>
> Here is the assignment: write a BreakOut game in ANS-Forth. I did this myself on the Commodore Vic-20 in line-number BASIC when I was about 16 years old (not as complicated as what I'm describing here; I ran into severe speed problems and had to keep things simple). I had to take recourse in unlawful carnal knowledge of BASIC to get my program to run at reasonable speed. You can write your program in ANS-Forth though because the modern computers are much faster than the Vic-20. Use these characters:
> ] these represent the left wall
> [ these represent the right wall
> O this represents your ball
> [#] these represent the bricks, which form a wall along the top of the screen (a space between)
> [=] these are like bricks, except that if you hit one you get another life
> [V] these represent spikes which are among the bricks in the wall along the top
> [O] these represent balls which are among the bricks in the wall along the top
> ===== this represents your paddle, which moves along the bottom of the screen
>
> The game is like a one-player version of Pong. You slide your paddle left and right (the left and right arrow keys can be used) to hit the ball so it bounces upwards. The ball bounces off the walls and off the bricks.
> 1.) When the ball hits a [#] it not only bounces off the brick, but it causes the brick to disappear.
> 2.) When the ball hits a [V] it not only bounces off the spike, but it causes the V to fall. Also, the ball bounces at a random angle.
> 3.) When the ball hits a [O] it not only bounces off the ball, but it causes the ball to fly away in the direction that the original ball came from.
>
> The wall looks like this:
>
> [#] [#] [#] [O] [#] [#] [#] [#] [V] [#] [O] [#] [#] [V] [#] [#] [#] [#] [#]
> [#] [#] [V] [#] [#] [V] [#] [O] [#] [#] [#] [#] [#] [#] [O] [#] [#] [#] [#]
> [#] [#] [#] [#] [V] [#] [#] [V] [#] [#] [#] [=] [#] [#] [#] [V] [#] [#] [#]
> [V] [#] [#] [#] [#] [=] [#] [#] [#] [#] [#] [V] [V] [#] [#] [#] [V] [#] [#]
>
> The [V] and [O] and [=] are distributed randomly in the wall. You can have several levels of difficulty. The first level would have only [#] in the wall. The next level would have some [V] in the wall. The next level would also have some [O] in the wall.
>
> The goal of the game is to break through the wall.
> If you fail to hit a ball with your paddle and the ball goes out the bottom of the screen, then you lose a life.
> If you hit a [=] then it disappears like a brick, but you also get another life.
> If you hit a [V] then the V drops (also, the ball bounces at a random angle) --- you have to avoid the falling spike because if it hits your paddle then you lose a life.
> If you hit a [O] then that O becomes live --- now you have more than one ball that you must keep in play with your paddle.
>
> Because we are using characters rather than graphics, there are a limited number of vectors that the ball can travel on:
> up 1 right 1
> up 1 right 2
> up 2 right 1
> up 1 left 1
> up 1 left 2
> up 2 left 1
> down 1 right 1
> down 1 right 2
> down 2 right 1
> down 1 left 1
> down 1 left 2
> down 2 left 1
>
> Write your program as a paced loop. This means that every X milliseconds, your ball(s) and spike(s) move up or down 1 char (you will have to figure out X by experimentation; determine what speed makes the game fun, but not so fast as to be unplayable). Unfortunately, one of the many failings of ANS-Forth is that it doesn't provide a standard way to check the system clock to determine how many milliseconds have elapsed (the TIME&DATE word is only accurate to seconds). You need these words:
> INIT-TIME ( -- ) initializes the time to zero
> TIME ( -- ms ) returns the number of milliseconds since SET-TIME was called
> Just choose an ANS-Forth compiler and ask your friendly compiler-vendor to provide these words for you. I recommend that you choose VFX because SwiftForth might be too slow for your game to be playable without recourse to assembly-language --- you don't want to have to delve into assembly-language on your first-ever program (these aren't the bad-old-days of the Vic-20 in which assembly-language was a must for almost any program; you have that advantage over me when I was writing this program).
>
> Good luck with your assignment! You can post messages on comp.lang.forth asking specific questions related to your assignment. You can't post any more idiotic messages such as: "could you re-implement myth2 soul-blighter game in forth?" You also can't post vague messages such as: "Um, my source-code file is empty. How should I, um, begin?" Note that these rules apply whether you accept the assignment or not --- quite frankly, we are all sick and tired of your idiotic questions --- you have to complete the assignment or nobody will respond to your posts any more! Programming is all about discipline --- you have to force yourself to work on the assignment until it is complete!
>
> Note that there is an element of irony in the choice of BreakOut as your first-ever Forth program. You have been trapped in the doldrums of attention-deficit-disorder for over 30 years --- now it is time to break out of the doldrums and write an actual computer program! --- you will have something to be proud of when you succeed!

I also said this:

On Thursday, June 16, 2016 at 11:36:47 PM UTC-7, hughag...@gmail.com wrote:
> You can write your program in Lisp or whatever if you prefer that language to Forth (you can even use Haskell or Ada; this would likely be the first time anybody has written a video game in either of those language!). Obviously, if you want technical help on comp.lang.forth then you must use Forth.. Also, if you want the awesome fame of getting your program in included in my novice-package, then you must use Forth. Learning Lisp is arguably more useful in the real-world than learning Forth though, so you might choose Lisp for that reason. Use whatever language you want! But, you must write the program and get it to work --- you can't just continue talk on the internet about programming, without doing any programming.

I would appreciate if you guys on comp.lang.lisp would support me in this --- don't allow any more idiotic messages from Gavino --- remind him of the need to complete his assignment.

Thank you for your consideration...
6 Answers

Norbert_Paul

6/17/2016 10:53:00 AM

0

hughaguilar96@gmail.com wrote:
> Over on comp.lang.forth we had this thread:
> https://groups.google.c...!topic/comp.lang.forth/qTDKxhW9758
>
> I said this:
>
> On Thursday, June 16, 2016 at 11:16:09 PM UTC-7, hughag...@gmail.com wrote:
>> On Thursday, June 16, 2016 at 7:58:17 PM UTC-7, hughag...@gmail.com wrote:
>>> On Wednesday, June 15, 2016 at 12:15:59 PM UTC-7, endlessboo...@gmail.com wrote:

You are waisting your time.

> I would appreciate if you guys on comp.lang.lisp would support me in this --- don't allow any more idiotic messages from Gavino --- remind him of the need to complete his assignment.
I don't support troll-feeding and I suppose the majority here doesn't too.

> Thank you for your consideration...
You might consider using a decent news-reader to read newsgroups.
As far as I remember, google-groups does not support kill-lists,
but this may have changed by now.

So this is my assignement for you:
(1) Find a news-reader of your choice. It should support kill-lists.
(2) Start reading c.l.l with this reader and stay away from groups.google.com.
(3) *PGONK* (where "G" stands for "Gavino")

Thank you for your consideration...
Norbert

hughaguilar96

6/17/2016 3:15:00 PM

0

On Friday, June 17, 2016 at 3:52:51 AM UTC-7, Norbert_Paul wrote:
> You are waisting your time.

I waste a lot of time every day --- that is pretty much what the internet is all about!

I'm trying to inspire Gavino to have some focus and discipline --- I could use some improvement in that area too --- how many internet-forum denizens can say that they don't?

Things were a lot different in the old days. It was common for people to write their own games and share them, and it was fun. Now we have games such as "Myth2 Soul-Blighter" that Gavino was recently asking about (same question posted on both c.l.f. and c.l.l.). I have no interest in playing such games at all! I really think that video games are a major contributor to attention-deficit-disorder (ADD). Nowadays there is a big crack-down on cigarettes, as if they are the worst thing ever --- I don't smoke, but I doubt that smoking causes significant health problems --- I would consider video games to be much more detrimental to health.

ADD is a big problem in America today. Gavino is the face of ADD on c.l.f. and c.l.l., but he is hardly the only person with ADD in America --- I see this problem everywhere --- something has to be done about it, or America will be in trouble.

Ugh! Bring back the good old days!

hughaguilar96

6/17/2016 3:36:00 PM

0

On Friday, June 17, 2016 at 8:15:28 AM UTC-7, hughag...@gmail.com wrote:
> Ugh! Bring back the good old days!

If I were to propose a law, for the benefit of American mental-health, this would be it:

All video games distributed publicly in America must run on a Commodore-64 emulator. Just to be nice, I would let it run at 2Mhz. rather than 1Mhz as the old C64 did have some speed issues in even the simplest games. I would also allow it to use a 6502 enhanced with a (zp,X),Y addressing-mode, as this would make programming much easier and hence more fun.

The only exceptions to this law would be Go and Chess games --- these don't really cause ADD because they require focus and discipline --- these also need a powerful computer to be competitive against humans (I can beat many computer Go programs).

endlessboomcapitalism

6/17/2016 6:52:00 PM

0

On Friday, June 17, 2016 at 2:49:55 AM UTC-4, hughag...@gmail.com wrote:
> Over on comp.lang.forth we had this thread:
> https://groups.google.c...!topic/comp.lang.forth/qTDKxhW9758
>
> I said this:
>
> On Thursday, June 16, 2016 at 11:16:09 PM UTC-7, hughag...@gmail.com wrote:
> > On Thursday, June 16, 2016 at 7:58:17 PM UTC-7, hughag...@gmail.com wrote:
> > > On Wednesday, June 15, 2016 at 12:15:59 PM UTC-7, endlessboo...@gmail..com wrote:
> > > > why?
> > > Programming is about writing programs...
> >
> > Gavino --- I'm going to be like a teacher and give you an assignment! These are the rules of the assignment:
> > 1.) Until you finish your assignment, you are not allowed to start any more of these idiotic threads on comp.lang.forth (or comp.lang.lisp etc.) --- if you do, you will just be reminded that you haven't finished your assignment.
> > 2.) When you finish your assignment, I will put your program in the novice-package --- you will be famous! --- there is no better path to Forth fame than this!
> >
> > Here is the assignment: write a BreakOut game in ANS-Forth. I did this myself on the Commodore Vic-20 in line-number BASIC when I was about 16 years old (not as complicated as what I'm describing here; I ran into severe speed problems and had to keep things simple). I had to take recourse in unlawful carnal knowledge of BASIC to get my program to run at reasonable speed. You can write your program in ANS-Forth though because the modern computers are much faster than the Vic-20. Use these characters:
> > ] these represent the left wall
> > [ these represent the right wall
> > O this represents your ball
> > [#] these represent the bricks, which form a wall along the top of the screen (a space between)
> > [=] these are like bricks, except that if you hit one you get another life
> > [V] these represent spikes which are among the bricks in the wall along the top
> > [O] these represent balls which are among the bricks in the wall along the top
> > ===== this represents your paddle, which moves along the bottom of the screen
> >
> > The game is like a one-player version of Pong. You slide your paddle left and right (the left and right arrow keys can be used) to hit the ball so it bounces upwards. The ball bounces off the walls and off the bricks.
> > 1.) When the ball hits a [#] it not only bounces off the brick, but it causes the brick to disappear.
> > 2.) When the ball hits a [V] it not only bounces off the spike, but it causes the V to fall. Also, the ball bounces at a random angle.
> > 3.) When the ball hits a [O] it not only bounces off the ball, but it causes the ball to fly away in the direction that the original ball came from.
> >
> > The wall looks like this:
> >
> > [#] [#] [#] [O] [#] [#] [#] [#] [V] [#] [O] [#] [#] [V] [#] [#] [#] [#] [#]
> > [#] [#] [V] [#] [#] [V] [#] [O] [#] [#] [#] [#] [#] [#] [O] [#] [#] [#] [#]
> > [#] [#] [#] [#] [V] [#] [#] [V] [#] [#] [#] [=] [#] [#] [#] [V] [#] [#] [#]
> > [V] [#] [#] [#] [#] [=] [#] [#] [#] [#] [#] [V] [V] [#] [#] [#] [V] [#] [#]
> >
> > The [V] and [O] and [=] are distributed randomly in the wall. You can have several levels of difficulty. The first level would have only [#] in the wall. The next level would have some [V] in the wall. The next level would also have some [O] in the wall.
> >
> > The goal of the game is to break through the wall.
> > If you fail to hit a ball with your paddle and the ball goes out the bottom of the screen, then you lose a life.
> > If you hit a [=] then it disappears like a brick, but you also get another life.
> > If you hit a [V] then the V drops (also, the ball bounces at a random angle) --- you have to avoid the falling spike because if it hits your paddle then you lose a life.
> > If you hit a [O] then that O becomes live --- now you have more than one ball that you must keep in play with your paddle.
> >
> > Because we are using characters rather than graphics, there are a limited number of vectors that the ball can travel on:
> > up 1 right 1
> > up 1 right 2
> > up 2 right 1
> > up 1 left 1
> > up 1 left 2
> > up 2 left 1
> > down 1 right 1
> > down 1 right 2
> > down 2 right 1
> > down 1 left 1
> > down 1 left 2
> > down 2 left 1
> >
> > Write your program as a paced loop. This means that every X milliseconds, your ball(s) and spike(s) move up or down 1 char (you will have to figure out X by experimentation; determine what speed makes the game fun, but not so fast as to be unplayable). Unfortunately, one of the many failings of ANS-Forth is that it doesn't provide a standard way to check the system clock to determine how many milliseconds have elapsed (the TIME&DATE word is only accurate to seconds). You need these words:
> > INIT-TIME ( -- ) initializes the time to zero
> > TIME ( -- ms ) returns the number of milliseconds since SET-TIME was called
> > Just choose an ANS-Forth compiler and ask your friendly compiler-vendor to provide these words for you. I recommend that you choose VFX because SwiftForth might be too slow for your game to be playable without recourse to assembly-language --- you don't want to have to delve into assembly-language on your first-ever program (these aren't the bad-old-days of the Vic-20 in which assembly-language was a must for almost any program; you have that advantage over me when I was writing this program).
> >
> > Good luck with your assignment! You can post messages on comp.lang.forth asking specific questions related to your assignment. You can't post any more idiotic messages such as: "could you re-implement myth2 soul-blighter game in forth?" You also can't post vague messages such as: "Um, my source-code file is empty. How should I, um, begin?" Note that these rules apply whether you accept the assignment or not --- quite frankly, we are all sick and tired of your idiotic questions --- you have to complete the assignment or nobody will respond to your posts any more! Programming is all about discipline --- you have to force yourself to work on the assignment until it is complete!
> >
> > Note that there is an element of irony in the choice of BreakOut as your first-ever Forth program. You have been trapped in the doldrums of attention-deficit-disorder for over 30 years --- now it is time to break out of the doldrums and write an actual computer program! --- you will have something to be proud of when you succeed!
>
> I also said this:
>
> On Thursday, June 16, 2016 at 11:36:47 PM UTC-7, hughag...@gmail.com wrote:
> > You can write your program in Lisp or whatever if you prefer that language to Forth (you can even use Haskell or Ada; this would likely be the first time anybody has written a video game in either of those language!). Obviously, if you want technical help on comp.lang.forth then you must use Forth. Also, if you want the awesome fame of getting your program in included in my novice-package, then you must use Forth. Learning Lisp is arguably more useful in the real-world than learning Forth though, so you might choose Lisp for that reason. Use whatever language you want! But, you must write the program and get it to work --- you can't just continue talk on the internet about programming, without doing any programming.
>
> I would appreciate if you guys on comp.lang.lisp would support me in this --- don't allow any more idiotic messages from Gavino --- remind him of the need to complete his assignment.
>
> Thank you for your consideration...

hey fuk u bro :)
hope this helps

endlessboomcapitalism

6/17/2016 6:53:00 PM

0

On Friday, June 17, 2016 at 6:52:51 AM UTC-4, Norbert_Paul wrote:
> hughaguilar96@gmail.com wrote:
> > Over on comp.lang.forth we had this thread:
> > https://groups.google.c...!topic/comp.lang.forth/qTDKxhW9758
> >
> > I said this:
> >
> > On Thursday, June 16, 2016 at 11:16:09 PM UTC-7, hughag...@gmail.com wrote:
> >> On Thursday, June 16, 2016 at 7:58:17 PM UTC-7, hughag...@gmail.com wrote:
> >>> On Wednesday, June 15, 2016 at 12:15:59 PM UTC-7, endlessboo...@gmail.com wrote:
>
> You are waisting your time.
>
> > I would appreciate if you guys on comp.lang.lisp would support me in this --- don't allow any more idiotic messages from Gavino --- remind him of the need to complete his assignment.
> I don't support troll-feeding and I suppose the majority here doesn't too.
>
> > Thank you for your consideration...
> You might consider using a decent news-reader to read newsgroups.
> As far as I remember, google-groups does not support kill-lists,
> but this may have changed by now.
>
> So this is my assignement for you:
> (1) Find a news-reader of your choice. It should support kill-lists.
> (2) Start reading c.l.l with this reader and stay away from groups.google.com.
> (3) *PGONK* (where "G" stands for "Gavino")
>
> Thank you for your consideration...
> Norbert

waisting of peace

Pascal J. Bourguignon

6/17/2016 7:49:00 PM

0

hughaguilar96@gmail.com writes:

> ADD is a big problem in America today. Gavino is the face of ADD on
> c.l.f. and c.l.l., but he is hardly the only person with ADD in
> America --- I see this problem everywhere --- something has to be done
> about it, or America will be in trouble.
>
> Ugh! Bring back the good old days!

Well, we all know who can bring back the good old days, or a good enough
approximation thereof. ;-)

--
__Pascal Bourguignon__ http://www.informat...
â??The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.� -- Carl Bass CEO Autodesk