Dark Bit Factory & Gravity

PROGRAMMING => Other languages => Yabasic => Topic started by: bikemadness on July 08, 2018

Title: Letter Colour Assign
Post by: bikemadness on July 08, 2018
Just something I've wanted to achieve.
An idea I wanted to apply to another program here.

`restore wishlistread listdim wish\$(list)for a=1 to listread wish\$(a)next arestore highlightread colsdim letters\$(cols)dim R(cols)dim G(cols)dim B(cols)for c=1 to colsread letters\$(c)read R(c)read G(c)read B(c)next csel=1open window 640,512repeatsetdispbuf vmvm=1-vmsetdrawbuf vmclear windowletter=0row=0c=peek("port1")if and(c,16)>0 scroll=scroll+15if and(c,64)>0 scroll=scroll-15if scroll>0 scroll=0if and(c,128)<>0 left=1if left=1 L=L+1if L>2 L=2if L=2 left=0if and(c,128)=0 L=0if left=1 sel=sel-1if sel<1 sel=3for a=1 to listspace=260/len(wish\$(a))if instr(wish\$(a),"*",0)=0 thenrow=row+1for b=1 to len(wish\$(a))for c=1 to colsif mid\$(wish\$(a),b,1)=letters\$(c) thenletter=letter+1setrgb 1,R(c),G(c),B(c)endifnext cif sel=1 text b*10+10,row*15+scroll,mid\$(wish\$(a),b,1)if sel=2 text b*10-(len(wish\$(a))*10)+260,row*15+scroll,mid\$(wish\$(a),b,1)if sel=3 text b*space,row*15+scroll,mid\$(wish\$(a),b,1)next bendifnext asetrgb 1,256,256,256text 10,(row+1)*15+scroll,"The "+str\$(row)+" listed are the ones I"text 10,(row+2)*15+scroll,"have of the "+str\$(maxnum)+" in my wishlist"text 10,(row+3)*15+scroll,str\$(letter)until (1=0)label wishlistdata 94data "A QUIET PLACE"data "*ACTS OF VIOLENCE"data "AMERICAN PASTORAL"data "ATLANTIC RIM RESURRECTION"data "AVENGERS INFINITY WAR"data "*BALLAD OF LEFTY BROWN. THE"data "*BEAST OF BURDEN"data "*BLACK PANTHER"data "*BRAVEN"data "*BREATHE"data "BROKEN"data "*BUTTERFLIES ARE FREE"data "BUTTERFLY TREE"data "CALL ME BY YOUR NAME"data "CHAOS"data "CHAPPAQUIDDICK"data "CIRCLE OF TWO"data "CITY OF GHOSTS"data "COCAINE GODMOTHER"data "COLD MOON"data "COMMANDO"data "*COMMUTOR. THE"data "DEVIL IN A BLUE DRESS"data "*DOCTOR DETROIT"data "ENDLESS. THE"data "EVERY DAY"data "EXCEPTION. THE"data "*FORGOTTEN. THE"data "FUNHOUSE. THE"data "GAME NIGHT"data "GARAGE SALE MYSTERY"data "GHOSTHOUSE"data "GORGEOUS"data "GRAVE OF THE FIREFLIES"data "GUARDIAN. THE"data "GUERNSEY. THE"data "*GUN SHY"data "HANGMAN"data "HERO. THE"data "HOWARDS END"data "HUMANITY BUREAU. THE"data "*HUNTERS PRAYER"data "I KILL GIANTS"data "*INSIDIOUS THE LAST KEY"data "JOURNEY. THE"data "KNIGHTS OF THE DAMNED"data "LADY BIRD"data "LAST FLAG FLYING"data "LITTLE VAMPIRE. THE"data "LONDON"data "*LOOKING GLASS"data "MARY AND THE WITCHS FLOWER"data "MARY MAGDALENE"data "MEAN MACHINE"data "MECHANIC RESURRECTION"data "MENASHE"data "MERCY. THE"data "MOLLYS GAME"data "MOM AND DAD"data "*MONEY TRAIN"data "*MONSTER FAMILY"data "MOUNTAIN"data "MY LIFE WITHOUT ME"data "*NINE"data "PACIFIC RIM UPRISING"data "PETER RABBIT"data "*PHANTOM THREAD"data "*PRESSURE"data "PROUD MARY"data "RAISING CAIN"data "RAMPAGE"data "READY PLAYER ONE"data "REANIMATOR TRILOGY"data "RECALL. THE"data "*RED SPARROW"data "RENEGADES"data "RETURN TO MONTAUK"data "REVOLVER"data "RUROUNI KENSHIN"data "RWBY"data "SAM I BLOOD"data "SECRET WINDOW"data "SILENT RUNNING"data "SINGULARITY"data "SNOWWHITE A TALE OF TERROR"data "STOP MAKING SENSE"data "STRANGERS PREY AT NIGHT. THE"data "SUICIDE SQUAD HELL TO PAY"data "TEACHER. THE"data "TOP GUN"data "TURN IT UP"data "TWELVE STRONG"data "VIEW FROM THE TOP"data "WEST AND THE RUTHLESS. THE"data "WILD CARD"data "WINCHESTER"label highlightdata 26data "A",255,125,5data "B",50,150,50data "C",175,75,145data "D",95,30,210data "E",255,255,5data "F",150,175,185data "G",210,115,30data "H",180,240,165data "I",255,5,5data "J",250,70,10data "K",195,40,10data "L",100,75,30data "M",180,180,180data "N",85,170,225data "O",5,255,5data "P",165,105,105data "Q",230,230,130data "R",255,200,200data "S",255,5,255data "T",80,80,205data "U",5,5,255data "V",200,150,35data "W",240,15,70data "X",15,15,90data "Y",65,140,250data "Z",45,160,85`