Jump to content
IGNORED

Filthy balls - a few challenges ...


Recommended Posts

So what's going down ? - The odd or even checker board thread started it (idflyfish). You know alternately having odd and even rows. Doing the bit fiddling with AND and OR (matthew180). Using it for Bricks and The Wall, speeding things up in different programming languages (matthew180, lucien2 and Willsy) , - and now going for 3D. What 3D ? - Well, the ball is kinda 3D (light reflection and all). Yeah, and then what ? - This time I'm going the other way around, I present the goal(s) and haven't got the solution - yet !

 

So the XB code at the start of the thread just present 'em balls, dropped to floor, and neatly arranged. Simple, nice and forgettable.

 

No, what I was thinking was, ISOMETRIC 3D. Isometric ? Yes, look it up. Many eighties games, especially on the ZX Spectrum/Timex, used this lovely technique of making something look 3D. Ant Attack, Q*Bert, Zaxxon, Congo Bongo, Knight Lore, Civilization II, Diablo ...

 

I went on to design the balls in an isometric world. Seeing the balls obliquely from above. And I thought, why not straight from above. Here's the graphics that I will use. If you want to beat me to it, go ahead. One XB demo doing isometrics and another with balls stacked and seen from straight above. Of course the balls have to be placed randomly etc. I think the stacking will be the biggest challenge (you can't have balls hovering in mid air).

 

balls0002_zpscb1d39a1.png

 

:)

Edited by sometimes99er
  • Like 1
Link to comment
Share on other sites

Hope you don't mind my playing around with your filthy balls... :roll:

 

100 RANDOMIZE
110 HITCLR=7 !COLOR WHEN HITS THE FLOOR; 2=NO CHANGE
120 MAXSPD=50 !DROP SPEED
130 CALL CLEAR :: CALL SCREEN(13):: CALL MAGNIFY(3)
140 CALL CHAR(40,"00071F3F7160F1EAFFFFFF7F7F3F1F0700C0F0F8FCFCFEFEFEFEFEFCFCF8F0C")
150 CALL SPRITE(#1,40,1,10,10)
160 R=INT(RND*12)*2+1 :: C=INT(RND*16)*2+1
170 CALL LOCATE(#1,8,C*8-7):: CALL COLOR(#1,2):: CALL MOTION(#1,INT(RND*MAXSPD+10),0)
180 Q=R*8-10 !-10=SOFT;-8=SLIGHT BUMP
190 CALL POSITION(#1,Y,X):: IF Y<=Q THEN 190
200 CALL MOTION(#1,0,0):: CALL LOCATE(#1,R*8-7,C*8-7):: CALL COLOR(#1,HITCLR)
210 CALL SCREEN(16)
220 CALL HCHAR(R,C,40):: CALL SCREEN(13):: CALL HCHAR(R+1,C,41):: CALL HCHAR(R,C+1,42):: CALL HCHAR(R+1,C+1,43)
230 GOTO 160

  • Like 1
Link to comment
Share on other sites

balls0003_zps3b55a296.png

 

Julie and Johnnie got married and she was at the drugstore looking at the men's toiletries. A clerk comes up to help her and asks if she needs assistance.

 

"I'm looking for some deodorant for my new husband Johnnie, but I don't know what type he uses."

 

The clerk says, "Is it the ball type ?"

 

"No," says Julie, "it's for his underarms."

 

:|

Edited by sometimes99er
Link to comment
Share on other sites

Here is a solution. Not elegant as your bricks and wall demos, the patterns are not generated and I have 4 IFs in the loop.

 

 

10 CALL SCREEN(3)
20 CALL CLEAR
100 CALL CHAR(32,"0000000000000000")
110 CALL CHAR(33,"00071E3F777EEFFF")
120 CALL CHAR(34,"00071F3F7F7FFFFF")
130 CALL CHAR(35,"00071F3F7160F1EA")
140 CALL CHAR(36,"FE7EF6DCFCBAF0C0")
150 CALL CHAR(37,"F8679EBF777EEFFF")
160 CALL CHAR(38,"F8679FBF7F7FFFFF")
170 CALL CHAR(39,"F8679FBF7160F1EA")
180 CALL CHAR(40,"FEFEFEFCFCF8F0C0")
190 CALL CHAR(41,"F8E79EBF777EEFFF")
200 CALL CHAR(42,"F8E79FBF7F7FFFFF")
210 CALL CHAR(43,"F8E79FBF7160F1EA")
220 CALL CHAR(44,"FEFEFEFCFCF8F0C0")
230 CALL CHAR(45,"F8E79EBF777EEFFF")
240 CALL CHAR(46,"F8E79FBF7F7FFFFF")
250 CALL CHAR(47,"F8E79FBF7160F1EA")
260 CALL CHAR(48,"0000000000000000")
270 CALL CHAR(49,"00C8F0F8BCFCFADE")
280 CALL CHAR(50,"00C0F0F8FCFCFEFE")
290 CALL CHAR(51,"00C0F0F8FCFCFEFE")
300 CALL CHAR(52,"FDBFF77F7DAF1F07")
310 CALL CHAR(53,"3DCFF3FBBDFDFADE")
320 CALL CHAR(54,"3DCFF3FBFDFDFEFE")
330 CALL CHAR(55,"3DCFF3FBFDFDFEFE")
340 CALL CHAR(56,"FFFFFF7F7F3F1F07")
350 CALL CHAR(57,"3FCFF3FBBDFDFADE")
360 CALL CHAR(58,"3FCFF3FBFDFDFEFE")
370 CALL CHAR(59,"3FCFF3FBFDFDFEFE")
380 CALL CHAR(60,"FFFFFF7F7F3F1F07")
390 CALL CHAR(61,"3FCFF3FBBDFDFADE")
400 CALL CHAR(62,"3FCFF3FBFDFDFEFE")
410 CALL CHAR(63,"3FCFF3FBFDFDFEFE")
420 CALL CHAR(64,"0000000000000000")
430 CALL CHAR(68,"FDBFF77F7DAF1E06")
440 CALL CHAR(72,"FFFFFF7F7F3F1E06")
450 CALL CHAR(76,"FFFFFF7F7F3F1E06")
500 R=INT(RND*23)+1
504 C=INT(RND*(15+(R AND 1)))*2+((R-1)AND 1)+1
510 CALL GCHAR(R,C,G)
520 V=G AND 3
530 IF V=3 THEN 1000
540 V=V+1
550 CALL HCHAR(R,C,(G AND 12)+V+32)
560 CALL GCHAR(R,C+1,G)
570 CALL HCHAR(R,C+1,(G AND 12)+V+48)
580 CALL GCHAR(R+1,C,G)
585 IF G<>32 THEN 590
586 G=48
590 CALL HCHAR(R+1,C,(G AND 115)+V*4)
600 CALL GCHAR(R+1,C+1,G)
610 CALL HCHAR(R+1,C+1,(G AND 3)+V*4+32)
620 IF C=1 THEN 1000
630 CALL GCHAR(R,C-1,G)
640 IF G AND 3 THEN 1000
650 CALL HCHAR(R,C-1,(G AND 12)OR 64)
1000 GOTO 500

 

  • Like 1
Link to comment
Share on other sites

Anyone besides me getting sick of the fact you can not cut and paste correctly on the web pages here anymore?

 

Just put it in code tags (if its code). What problem are you having?

 

 

When I try to cut and paste back into Classic99 it is all one line, I have to cut and paste each line individually or copy to Notepad and fix it but hitting enter and putting each line on a line instead of the whole thing being one single line.

Never used to have this problem. Any text on a page should have a cr(Carridge return) at the end as this is standard PC format for all text. Otherwise all text is just one single line endlessly.

This would even screw up a C program listing as the program would just be one single line.It looks fine on the web page but makes it impossible to cut and paste from this web site.

Edited by RXB
Link to comment
Share on other sites

Can you give me an example of a post that doesn't work for you?

 

 

Sure, when I cut and paste in to Notepad it looks like this from anyones code on the page. This is from the code Lucien2 posted:

10 CALL SCREEN(3)20 CALL CLEAR100 CALL CHAR(32,"0000000000000000")110 CALL CHAR(33,"00071E3F777EEFFF")120 CALL CHAR(34,"00071F3F7F7FFFFF")130 CALL CHAR(35,"00071F3F7160F1EA")140 CALL CHAR(36,"FE7EF6DCFCBAF0C0")150 CALL CHAR(37,"F8679EBF777EEFFF")160 CALL CHAR(38,"F8679FBF7F7FFFFF")170 CALL CHAR(39,"F8679FBF7160F1EA")180 CALL CHAR(40,"FEFEFEFCFCF8F0C0")190 CALL CHAR(41,"F8E79EBF777EEFFF")200 CALL CHAR(42,"F8E79FBF7F7FFFFF")210 CALL CHAR(43,"F8E79FBF7160F1EA")220 CALL CHAR(44,"FEFEFEFCFCF8F0C0")230 CALL CHAR(45,"F8E79EBF777EEFFF")240 CALL CHAR(46,"F8E79FBF7F7FFFFF")250 CALL CHAR(47,"F8E79FBF7160F1EA")260 CALL CHAR(48,"0000000000000000")270 CALL CHAR(49,"00C8F0F8BCFCFADE")280 CALL CHAR(50,"00C0F0F8FCFCFEFE")290 CALL CHAR(51,"00C0F0F8FCFCFEFE")300 CALL CHAR(52,"FDBFF77F7DAF1F07")310 CALL CHAR(53,"3DCFF3FBBDFDFADE")320 CALL CHAR(54,"3DCFF3FBFDFDFEFE")330 CALL CHAR(55,"3DCFF3FBFDFDFEFE")340 CALL CHAR(56,"FFFFFF7F7F3F1F07")350 CALL CHAR(57,"3FCFF3FBBDFDFADE")360 CALL CHAR(58,"3FCFF3FBFDFDFEFE")370 CALL CHAR(59,"3FCFF3FBFDFDFEFE")380 CALL CHAR(60,"FFFFFF7F7F3F1F07")390 CALL CHAR(61,"3FCFF3FBBDFDFADE")400 CALL CHAR(62,"3FCFF3FBFDFDFEFE")410 CALL CHAR(63,"3FCFF3FBFDFDFEFE")420 CALL CHAR(64,"0000000000000000")430 CALL CHAR(68,"FDBFF77F7DAF1E06")440 CALL CHAR(72,"FFFFFF7F7F3F1E06")450 CALL CHAR(76,"FFFFFF7F7F3F1E06")500 R=INT(RND*23)+1504 C=INT(RND*(15+(R AND 1)))*2+((R-1)AND 1)+1510 CALL GCHAR(R,C,G)520 V=G AND 3530 IF V=3 THEN 1000540 V=V+1550 CALL HCHAR(R,C,(G AND 12)+V+32)560 CALL GCHAR(R,C+1,G)570 CALL HCHAR(R,C+1,(G AND 12)+V+48)580 CALL GCHAR(R+1,C,G)585 IF G<>32 THEN 590586 G=48590 CALL HCHAR(R+1,C,(G AND 115)+V*4)600 CALL GCHAR(R+1,C+1,G)610 CALL HCHAR(R+1,C+1,(G AND 3)+V*4+32)620 IF C=1 THEN 1000630 CALL GCHAR(R,C-1,G)640 IF G AND 3 THEN 1000650 CALL HCHAR(R,C-1,(G AND 12)OR 64)1000 GOTO 500

 

If I cut and paste from this web page to another it works fine but the above is what happens to notepad. Or Classic99 when I try to use the code.I am using Internet Explorer 9 by the way.

Edited by RXB
Link to comment
Share on other sites

COPY PASTE FIX

 

I have the same problem when copying from MSIE (Internet Explorer) to Classic99 or NotePad. Not a problem from Opera or FireFox.

 

I can fix it from MSIE by copying to WordPad (typically under Accessories) or Word, then selecting all the text using Ctrl+A, and then pasting into Classic99 (or NotePad).

 

Maybe Tursi can fix it, since the clipboard must have some kind of linefeed information.

 

:)

 

Edit: Remember a Ctrl+C after the Ctrl+A !

Edited by sometimes99er
Link to comment
Share on other sites

COPY PASTE FIX

 

I have the same problem when copying from MSIE (Internet Explorer) to Classic99 or NotePad. Not a problem from Opera or FireFox.

 

I can fix it from MSIE by copying to WordPad (typically under Accessories) or Word, then selecting all the text using Ctrl+A, and then pasting into Classic99 (or NotePad).

 

Maybe Tursi can fix it, since the clipboard must have some kind of linefeed information.

 

:)

 

Also not a problem for google chrome.

Link to comment
Share on other sites

Yeah, it's IE specific. For some stupid reason (and I hate to pick on MS, but this is really stupid), the TEXT data placed on the clipboard strips all line ending information. There are several other copies of the same data on the clipboard, as far as I could see, only the RTF version includes the line ending information.

 

I updated Classic99 to understand this and posted a new version, but it does not work with the example in this thread (I tried it myself). The code can't find the RTF tagged data (at least, not using the value I had working last time.)

 

I'll see if I can fix this up.

Link to comment
Share on other sites

Pyramid challenge

 

Let's take a breif look at the other challenge, the stacking of balls in something ultimately being a pyramid I guess. Some physics has to apply like balls can't hover and then has to rest on the floor or on other balls - I guess it needs 4 balls to be at peace. One could place balls where possible, or release balls and let them roll into place or out of sight - sprites come to mind ...

 

 

Isometric solution - The graphics

 

I don't know exactly how lucien2 got the graphics from post #6 to post #10.

 

It might have involved copying and pasting into a graphics editor. But it could also be freehand work in something like Magellan. With this tool you can import certain graphics, draw graphics and export graphics and code. I use Paint Shop Pro 6 for graphics, and my own Grapefruit for code. I haven't done any mapping as such, but when I do, I will certainly use Magellan.

 

The missing graphics for layout effects had to be done. The shiny ball was already there, and would serve as a template for working out effects on filthy and clean balls. And to me it looks as if lucien2 got it pixel perfect.

 

 

Isometric solution - The logic

 

Then I guess one have to work out if bit fiddling will help/be possible with the challenge ahead (the isometric one). Arranging things there, and maybe having some characters be the same in the ASCII layout or using lookup tables is probably the greatest challenge. Once that is worked out, I think the programming is sort of easy.

 

One might then take another look at the code, and/or revisit the solution to see if one can be smart about something. Any level of logic might be up for some rethinking. Sometimes, if it works, it works - and that's always nice. Smart itself can often be perceived as complicated or spaghetti like.

 

 

Isometric solution - The rip

 

Copy and paste the code to Classic99.

Run.

Press F10 to dump RAM.

Run Limelight.

Load VDPDUMP.BIN

Press Offset.

Save the graphics as GIF (this can now be included in Magellan and Grapefruit).

 

balls0004_zpsa2d857ed.png

 

 

:)

Edited by sometimes99er
Link to comment
Share on other sites

The missing graphics for layout effects had to be done. The shiny ball was already there, and would serve as a template for working out effects on filthy and clean balls. And to me it looks as if lucien2 got it pixel perfect.

Not really perfect. The white circle is the selection tool from GIMP. The red points need to be black, not white.

 

corrected%20patterns.PNG

 

EDIT: Here is the program with the corrected patterns

 

10 CALL SCREEN(3)
20 CALL CLEAR
100 CALL CHAR(32,"0000000000000000")
110 CALL CHAR(33,"00071E3F777EEFFF")
120 CALL CHAR(34,"00071F3F7F7FFFFF")
130 CALL CHAR(35,"00071F3F7160F1EA")
140 CALL CHAR(36,"FE7EF6DCFCBAF0C0")
150 CALL CHAR(37,"F867DEBF777EEFFF")
160 CALL CHAR(38,"F867DFBF7F7FFFFF")
170 CALL CHAR(39,"F867DFBF7160F1EA")
180 CALL CHAR(40,"FEFEFEFCFCF8F0C0")
190 CALL CHAR(41,"F8E7DEBF777EEFFF")
200 CALL CHAR(42,"F8E7DFBF7F7FFFFF")
210 CALL CHAR(43,"F8E7DFBF7160F1EA")
220 CALL CHAR(44,"FEFEFEFCFCF8F0C0")
230 CALL CHAR(45,"F8E7DEBF777EEFFF")
240 CALL CHAR(46,"F8E7DFBF7F7FFFFF")
250 CALL CHAR(47,"F8E7DFBF7160F1EA")
260 CALL CHAR(48,"0000000000000000")
270 CALL CHAR(49,"00C8F0F8BCFCFADE")
280 CALL CHAR(50,"00C0F0F8FCFCFEFE")
290 CALL CHAR(51,"00C0F0F8FCFCFEFE")
300 CALL CHAR(52,"FDBFF77F7DAF1F07")
310 CALL CHAR(53,"3DCFF7FBBDFDFADE")
320 CALL CHAR(54,"3DCFF7FBFDFDFEFE")
330 CALL CHAR(55,"3DCFF7FBFDFDFEFE")
340 CALL CHAR(56,"FFFFFF7F7F3F1F07")
350 CALL CHAR(57,"3FCFF7FBBDFDFADE")
360 CALL CHAR(58,"3FCFF7FBFDFDFEFE")
370 CALL CHAR(59,"3FCFF7FBFDFDFEFE")
380 CALL CHAR(60,"FFFFFF7F7F3F1F07")
390 CALL CHAR(61,"3FCFF7FBBDFDFADE")
400 CALL CHAR(62,"3FCFF7FBFDFDFEFE")
410 CALL CHAR(63,"3FCFF7FBFDFDFEFE")
420 CALL CHAR(64,"0000000000000000")
430 CALL CHAR(68,"FDBFF77F7DAF1E06")
440 CALL CHAR(72,"FFFFFF7F7F3F1E06")
450 CALL CHAR(76,"FFFFFF7F7F3F1E06")
500 R=INT(RND*23)+1
504 C=INT(RND*(15+(R AND 1)))*2+((R-1)AND 1)+1
510 CALL GCHAR(R,C,G)
520 V=G AND 3
530 IF V=3 THEN 1000
540 V=V+1
550 CALL HCHAR(R,C,(G AND 12)+V+32)
560 CALL GCHAR(R,C+1,G)
570 CALL HCHAR(R,C+1,(G AND 12)+V+48)
580 CALL GCHAR(R+1,C,G)
585 IF G<>32 THEN 590
586 G=48
590 CALL HCHAR(R+1,C,(G AND 115)+V*4)
600 CALL GCHAR(R+1,C+1,G)
610 CALL HCHAR(R+1,C+1,(G AND 3)+V*4+32)
620 IF C=1 THEN 1000
630 CALL GCHAR(R,C-1,G)
640 IF G AND 3 THEN 1000
650 CALL HCHAR(R,C-1,(G AND 12)OR 64)
1000 GOTO 500

 

Edited by lucien2
  • Like 1
Link to comment
Share on other sites

Okay, I found out what I did wrong. I mistakenly assumed that clipboard formats were all fixed, but the rich text format used by Internet Explorer is a registered type, and the value can change from run to run. Classic99 now registers with the system to get that format, too, so it should work correctly now.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...