? Summer Programming Contest 2017 (Page 7) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

📣 Summer Programming Contest 2017

1 2 3 4 5 6 7 8 9 10 11
  • #121 ✎ 128 Nathaniel Spring 2017 Contest Winner I won the SmileBASIC Source Spring 2017 Contest! Programming Contest Helper Received for being very helpful around SmileBASIC Source Achievements Staff Pick "Your program is one of our favorites!" - Staff Achievements Update: I made a huge platformer OSP using text compression. I think I'll use this instead of 3D Pong. Current key: E3S3VXQF EDIT: This has been changed. Posted Edited by Nathaniel
  • #122 ✎ 1187 12Me21 Admin Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Helper Received for being very helpful around SmileBASIC Source Achievements Special Admin Hidden Easter Eggs
    Update: I made a huge platformer OSP using text compression. I think I'll use this instead of 3D Pong. Current key: E3S3VXQF
    You don't need to use FLOOR since MOD sucks and only works with integers. Also if you just use a more simple packing algorithm and store two 8-bit values per character, you can decode it without needing a list of characters (since SB uses a 16 bit encoding), or if you reduce the list down to 31 unique characters, you could fit 3 per character instead of just 2. And if you store the level data in a separate variable, you can just do A$=VAR("0:WHATEVER$") in the compressed program, rather than PRGSETing it.
    Posted Edited by 12Me21
  • #123 ✎ 128 Nathaniel Spring 2017 Contest Winner I won the SmileBASIC Source Spring 2017 Contest! Programming Contest Helper Received for being very helpful around SmileBASIC Source Achievements Staff Pick "Your program is one of our favorites!" - Staff Achievements
    Also if you just use a more simple packing algorithm and store two 8-bit values per character, you can decode it without needing a list of characters (since SB uses a 16 bit encoding)
    I understand everything but this part. Can you show an example on here like: A$="UNCOMPRESSED TEXT" 'COMPRESSING ALGORITHM CLIPBOARD A$ 'DECOMPRESSING ALGORITHM
    Posted Edited by Nathaniel
  • #124 ✎ 1187 12Me21 Admin Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Helper Received for being very helpful around SmileBASIC Source Achievements Special Admin Hidden Easter Eggs A$="UNCOMPRESSED TEXT "'even length FOR I=0 TO LEN(A$)-1 STEP 2 INC B$,CHR$(ASC(A$[I]) OR ASC(A$[I+1])<<8) NEXT CLIPBOARD B$ FOR I=0 TO LEN(B$)-1 B=ASC(B$[I]) INC C$,CHR$(B AND &HFF) INC C$,CHR$(B>>8) NEXT ?C$ Here's a really short version: 'compressor FOR I=0 TO LEN(A$)-1 STEP 2 UNSHIFT B$,CHR$(ASC(A$[I]) OR ASC(A$[I+1])<<8) NEXT 'decompressor WHILE""<B$B=ASC(POP(B$))C$=C$+CHR$(255AND B)+CHR$(B>>8)WEND I feel like compressing the code isn't really true OSP anymore though, but it's not technically breaking any of the contest rules, so I guess it's allowed. Posted Edited by 12Me21
  • #125 ✎ 709 Lumage I had a lot of fun with this! I loved seeing everyone's entries, too! Here's mine, a simplified Lindenmayer system expander and interpreter with a ruleset generator: 【V3S3XJQS】key graciously donated by 12Me21 and may be revoked without notice The interpreter supports stochastic and bracketed (branching) grammars. Gravity affects plant growth. The symbol strings can get very large after a few generations! So please be patient during the drawing process. If the "plant" is swaying, that means it's done drawing. The rule generator uses symbol bigram frequencies I got from some example L-systems to generate results better than random generation, but still often makes less-impressive knots, vines, and snares. About 1 in 8 look nice, though! For this reason, it's best to run it from direct mode. Specifying a seed allows you to generate the same plant by recording the seed value. Try 2, 4731, and 14522. To disable it, see the Editing Guide. I didn't get to add everything I wanted, such as leaf, bud, and flower nodes, or a third dimension (and rendering), or evolutionary selection... but I think it's almost fair for an OSP. You can read more about L-systems here: https://en.wikipedia.org/wiki/L-system ACLS:INPUT"SEED";E:RANDOMIZE.,E:GPAGE.,4GCLS:B$="ABC"F$=B$*3+"["*10+"+-"P$=(B$*3+"+")*2M$=(B$*3+"[-")*2N$="-+"*8+B$+"["E$=B$*2+"["*6+"++--"DIM R$[3,13]FOR I=0TO 2P=10S=0WHILE.<P:N=RND(P)+1P=P-N:R$[I,S]=STR$(100-P*10)A$=(B$*3+"[")[RND(10)]R$[I,S+1]=A$FOR J=RND(6)TO 6U$="]"*K:Q=21Q$=F$+U$*2IF"+"==A$THEN Q=20Q$=P$ELSEIF"-"==A$THEN Q=22Q$=M$ELSEIF"["==A$THEN Q=20Q$=N$ELSEIF"]"==A$THEN Q=16Q$=E$ENDIF:A$=(Q$+U$)[RND(Q+K)]K=K+2*(ABS(INSTR("] [",A$))-1)INC R$[I,S+1],A$+">"*MAX(MIN(K,2),0)NEXT:INC R$[I,S+1],"]"*(K/2)S=S+2K=0WEND:NEXT:DEF GR(C)J=RND(100)N=0WHILE J>VAL(R$[C,N])N=N+2WEND:RETURN R$[C,N+1]END:DEF EV(S$)FOR I=0TO LEN(S$)-1C=ASC(S$[I])IF C>64&&C<91THEN:G$=GR(C-65)S$[I]=G$I=I+LEN(G$)-1:ENDIF:NEXT:RETURN S$END:DEF LD S$DIM H[0]X=0Y=240w=90V=1D=RND(3)+1WHILE.<LEN(S$)&&Y>-20C=ASC(SHIFT(S$))IF C==91THEN PUSH H,V:PUSH H,w:PUSH H,Y:PUSH H,X:ELSEIF C>92THEN X=POP(H)Y=POP(H)w=POP(H)V=POP(H)ELSEIF C<44THEN w=w+20:ELSEIF C==45THEN w=w-20 ELSEIF C==60THEN V=V-2:ELSEIF C==62THEN V=V+2 ELSEIF C>64&&C<91THEN O=RGB(150-V/2,132+V,108-V)FOR I=0TO D:IF Y<-10THEN BREAK:ENDIF:w=w+SGN(X)*ATAN(X,Y+X*(V/&HC350))X=X+COS(RAD(w)):Y=Y-SIN(RAD(w))GPSET X+200,Y,O:NEXT:ENDIF:WEND:END:SPSET.,0,0,#R,#R:SPHOME.,200,240SPOFS.,200,240M$="A"@L:Z=Z+PI()/48?"A Grow"WAIT:CLS:IF BUTTON(2)THEN M$=EV(M$)T$=M$*1LD T$ENDIF:SPROT.,2.5*SIN(Z)[email protected] Removing the Seed Prompt: If you don't care about the randomization seed (the screenshots were generated without it), you can remove INPUT"SEED";E:RANDOMIZE.,E: on the first line. Defining L-systems: It's possible to use your own L-system ruleset, as well. To do so without destroying the generator code, insert a line break on the 26th wrapped line at column position 22, after :WEND:END and define rules by accessing indexes of the 2-dimensional array R. The first dimension of R$ corresponds to letter symbols A-Z: R$[0] is the rule for replacing A, R$[1] for B, and so on. The second dimension is the replacement rules for the corresponding symbol. Every n*2 index starting at n=0 is the probability (as a string) that the following replacement will be made, from 0 to 100. Every n*2+1 index is the replacement. Thus A -> B[+A][-A]BA B ->(.5) BB ->(.5) BBB would be declared with R$[0,0]="100"R$[0,1]="B[+A][-A]BA" R$[1,0]="50"R$[1,1]="BB"R$[1,2]="50"R$[1,3]="BBB" The default size declaration of R$[] is found on the fourth wrapped line, at the second column. The generator uses only symbols A through C for rules. To disable the generator, insert a linebreak on the 12th line in the 24th position (before DEF) and begin a comment at the 13th column of the fourth wrapped line, before "FOR I=0." The symbol table used is shown below. A-Z : Advance growth by one unit. Used for expansions. - : Decrease angle by 20 degrees + : Increase angle by 20 degrees > : Shift color towards green by 2 units < : Shift color towards brown by 2 units [ : Push state to the stack ] : Pop state from the stack Angle changes are a constant 20 degrees, and unit growth is controlled by the randomized variable D in LD() [L_DRAW()]. For best effects, increase the color with > a few times when beginning a branch. Posted Edited by Lumage
  • #126 ✎ 55 brilliance360 First Week Joined in the very first week of SmileBASIC Source Website Spring 2017 Contest Participant I participated in the SmileBASIC Source Spring 2017 Contest! Programming Contest Deep Sleep Hidden Website Title: Defender How to Play: Tap enemy ships to destroy them Key: 2J7E33QJ Posted
  • #127 ✎ 121 Picy3 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Star Wars Is Awesome! I love Star Wars! Express Yourself
    ill probably be like the last submission lol, cause it keeps changing ideas but idk now.. need something good
    No, I will be lol, I just got sick, my grandparents are here so I have no time to program with all the fun events, work, and daily chores. By the end of it all, the last of my energy is spent watching youtube and anime lmao. EDIT:(I also have been having trouble making an entry)
    yeah i really need to finish mine today lol. EDIT: lol by today i mean tomorrow at like midnight.
    Posted Edited by Picy3
  • #128 ✎ 68 calc84maniac OSP Contest 1 Winner I won the first SmileBASIC Source OSP Contest! Programming Contest Amazing Page Hidden Achievements Scholar Received for knowing a great deal about programming topics Achievements Here's my entry, Frog Guy: https://smilebasicsource.com/page?pid=852 Key: 5D7X33N4 Updated following some optimization advice. Posted Edited by calc84maniac
  • #129 ✎ 128 Nathaniel Spring 2017 Contest Winner I won the SmileBASIC Source Spring 2017 Contest! Programming Contest Helper Received for being very helpful around SmileBASIC Source Achievements Staff Pick "Your program is one of our favorites!" - Staff Achievements Final update, this project is now compressed far beyond anything should ever be. Huge Platformer OSP- current key: 4RF5Z3N3. Posted
  • #130 ✎ 1187 12Me21 Admin Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Helper Received for being very helpful around SmileBASIC Source Achievements Special Admin Hidden Easter Eggs There's an even shorter decompressor: A$="<data>"WHILE""<A$A=ASC(POP(A$))...WEND FOR I=0TO 1000:A=ASC("<data>"[I])...WEND (replace 1000 with the compressed text length) Posted
  • #131 ✎ 128 Nathaniel Spring 2017 Contest Winner I won the SmileBASIC Source Spring 2017 Contest! Programming Contest Helper Received for being very helpful around SmileBASIC Source Achievements Staff Pick "Your program is one of our favorites!" - Staff Achievements
    There's an even shorter decompressor: A$="<data>"WHILE""<A$A=ASC(POP(A$))...WEND FOR I=0TO 1000:A=ASC("<data>"[I])...WEND (replace 1000 with the compressed text length)
    I think I'm done with this project. But, thanks for all the help!
    Posted
  • #132 ✎ 770 snail_ Helper Received for being very helpful around SmileBASIC Source Achievements Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength OSP Contest 1 Contest Participant I participated in the first SmileBASIC Source OSP Contest! just so you're paying attention i updated my post Posted
  • #133 ✎ 1187 12Me21 Admin Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Helper Received for being very helpful around SmileBASIC Source Achievements Special Admin Hidden Easter Eggs
    just so you're paying attention i updated my post
    Instead of DATA for the colors, you could do something like RGB(C MOD 2<<8,(2AND C)<<8,C>>2<<8) Also, I think you put " CIRC" instead of "CIRCLE" by accident.
    Posted Edited by 12Me21
  • #134 ✎ 770 snail_ Helper Received for being very helpful around SmileBASIC Source Achievements Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength OSP Contest 1 Contest Participant I participated in the first SmileBASIC Source OSP Contest!
    just so you're paying attention i updated my post
    Instead of DATA for the colors, you could do something like RGB(C MOD 2<<8,(2AND C)<<8,C>>2<<8) Also, I think you put " CIRC" instead of "CIRCLE" by accident.
    It's called CIRC on purpose because 5 characters to a tool name. Also that algorithm to get the colors is confusing could you explain a bit.
    Posted
  • #135 ✎ 65 Trinitro21 First Week Joined in the very first week of SmileBASIC Source Website Query Denied Hidden Easter Eggs Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength 2DVEH3Q4 This was pretty fun to make. Touch the screen to do something. Move the circle pad to do something else. Posted
  • #136 ✎ 1187 12Me21 Admin Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Helper Received for being very helpful around SmileBASIC Source Achievements Special Admin Hidden Easter Eggs
    just so you're paying attention i updated my post
    Instead of DATA for the colors, you could do something like RGB(C MOD 2<<8,(2AND C)<<8,C>>2<<8) Also, I think you put " CIRC" instead of "CIRCLE" by accident.
    It's called CIRC on purpose because 5 characters to a tool name. Also that algorithm to get the colors is confusing could you explain a bit.
    CIRC has 4 letters though lol
    Posted
  • #137 ✎ 770 snail_ Helper Received for being very helpful around SmileBASIC Source Achievements Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength OSP Contest 1 Contest Participant I participated in the first SmileBASIC Source OSP Contest!
    just so you're paying attention i updated my post
    Instead of DATA for the colors, you could do something like RGB(C MOD 2<<8,(2AND C)<<8,C>>2<<8) Also, I think you put " CIRC" instead of "CIRCLE" by accident.
    It's called CIRC on purpose because 5 characters to a tool name. Also that algorithm to get the colors is confusing could you explain a bit.
    CIRC has 4 letters though lol
    CIRCLE has 6. Your point?
    Posted
  • #138 ✎ 1187 12Me21 Admin Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Helper Received for being very helpful around SmileBASIC Source Achievements Special Admin Hidden Easter Eggs
    just so you're paying attention i updated my post
    Instead of DATA for the colors, you could do something like RGB(C MOD 2<<8,(2AND C)<<8,C>>2<<8) Also, I think you put " CIRC" instead of "CIRCLE" by accident.
    It's called CIRC on purpose because 5 characters to a tool name. Also that algorithm to get the colors is confusing could you explain a bit.
    CIRC has 4 letters though lol
    CIRCLE has 6. Your point?
    oh... I guess I can't count lol Why not CIRCL or CRCLE or something, though?
    Posted Edited by 12Me21
  • #139 ✎ 77 Giant_Gamer Spring 2017 Contest Participant I participated in the SmileBASIC Source Spring 2017 Contest! Programming Contest Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Winter 2016 Contest Participant I participated in the SmileBASIC Source Winter 2016 Contest! Programming Contest
    There's an even shorter decompressor: A$="<data>"WHILE""<A$A=ASC(POP(A$))...WEND FOR I=0TO 1000:A=ASC("<data>"[I])...WEND (replace 1000 with the compressed text length)
    I think I'm done with this project. But, thanks for all the help!
    I'm not going to pretend to understand what I'm looking at... But I do have a few questions: How do you know what symbol of [x] you are using? And given that there is no [x] Character on the Keyboard, how did you type the source code up?
    Posted Edited by Giant_Gamer
  • #140 ✎ 709 Lumage He didn't type it, he used another program to compress it. Posted
1 2 3 4 5 6 7 8 9 10 11