Log In  
Log In  

Cart [#12014#] | 2015-07-29 | No License | Embed
5

so based on a conversation from another thread, I decided to do an implementation of the one line program :
10 PRINT CHR$(205.5+RND(1)); : GOTO 10

now i'm a hobbyist programer at best, so I pose the challenge to the community, what's the smallest program you can write to recreate this effect?

this is my effort - using sprites and in 50 tokens

P#12015 2015-07-29 16:40 ( Edited 2015-08-01 22:09)

Hah, that's really nice. When I've had some sleep I'll have a go at this :)

P#12018 2015-07-29 17:25 ( Edited 2015-07-29 21:25)
:: Mozz

there's no way to print unicode characters is there?

edit: oh yeah! and my original idea for getting the program in the smallest space was to use poke() to draw a character directly to the screen, but my technical knowledge failed me on that point

P#12021 2015-07-29 18:24 ( Edited 2015-07-29 22:32)
4

Some sprite variants:

Version A (36 tokens):

Cart [#12106#] | 2015-07-31 | No License | Embed
4

Version B (36 tokens):

Cart [#12107#] | 2015-07-31 | No License | Embed
4

Classical scrolling

Version C (49 tokens):

Cart [#12109#] | 2015-07-31 | No License | Embed
4

Real Smooth scrolling

I claim no expertise in writing super-laconic code.

P#12110 2015-07-31 16:10 ( Edited 2015-07-31 20:10)

Love the last one!

Well, love all of them, but the last one is super hypnotic.

P#12122 2015-07-31 18:23 ( Edited 2015-07-31 22:23)

This is so not in my wheelhouse, but I love the idea of it and am curious if folks come up with any other clever hacks. I'm mostly coming up with little ideas that are worse:

  1. I was able to cleverly add a few characters to YellowAfterlife's 36 char solution by replacing T%128 with BAND(T,127) -- at least it's more cryptic that way!

  2. What if we give SPR() fewer parameters? We can call SPR(RND(2)) and skip those x and y coordinate params entirely, since it'll supply 0,0 by default! As long as we precede that with a call to CAMERA() that includes the parameters instead plus some extra char overhead. Woo!

  3. The map! The map uses 8:1 pixel ratios! That means we can use smaller numbers! 128 becomes 16, that's a whole character less, and we can do that twice! And also spend a bunch of extra characters since we have to call both mset and map, and feed map the params 0,0,0,0,16,16 just to get it those 16s and paint the whole screen. Also, RND(2) needs to become RND(2)+1 and we offset the sprites by a position, since map() treats 0 values specially as blank tiles.

  4. Replace integer constants with a short variable name! 16 shows up five times in the map/mset variant, with the three 16s in the math and the two in the map() call, so lets replace all five with "S" and do S=16 and come out exactly one character better than before!

  5. S is a really great looking letter, let's use that more. T=0? More like T=S-S. T+=1? No, T+=S/S. RND(2)+1? Meet my good friend RND(S+S)/S+S/S.

S. SSSSSSS

P#12126 2015-07-31 18:45 ( Edited 2015-07-31 22:45)
4

Cart [#12132#] | 2015-08-01 | No License | Embed
4

P#12133 2015-07-31 22:00 ( Edited 2015-08-01 02:00)

@joshmillard what a lovely listing, almost code poetry you've got going on there, going to be tricky to beat.

P#12138 2015-08-01 03:24 ( Edited 2015-08-01 07:24)
2

Cheating in absolutely every respect for 30 tokens:

Cart [#12148#] | 2015-08-01 | No License | Embed
2

P#12149 2015-08-01 09:56 ( Edited 2015-08-01 13:56)
:: Mozz

oh these are all fantastic :D

P#12154 2015-08-01 11:27 ( Edited 2015-08-01 15:27)

That is great, zaratustra.

P#12164 2015-08-01 16:08 ( Edited 2015-08-01 20:08)

yeah, I don't think yellowafterlife's versions can be beaten on token count, unless the drawn pattern is changed. (or cheated. =) )

P#12168 2015-08-01 18:09 ( Edited 2015-08-01 22:09)

[Please log in to post a comment]

X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2018-12-13 00:00 | 0.041s | 4194k | Q:80