Board Logo
« a kind of bit map to main window & text file »

Welcome Guest. Please Login or Register.
Apr 24th, 2017, 4:02pm


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Please use the forums Search feature before asking.
Please post code using the code box described in Format Your Messages.
This will keep indentation, separate it better form the message and prevent gibberish.
If the code is too long for one post or additional files are needed, upload a ZIP archive to the Just BASIC Files Archive Site.

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: a kind of bit map to main window & text file  (Read 120 times)
zzz000abc
Full Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 220
xx a kind of bit map to main window & text file
« Thread started on: Mar 20th, 2017, 05:32am »

hi,
here is a kind of bitmap program:
Code:
        r1$="0,0,1,0,0;"
        r2$="0,0,1,0,0;"
        r3$="0,0,1,0,0;"
        r4$="1,0,1,0,0;"
        r5$="1,1,1,0,0;"
        bmp$=r1$+r2$+r3$+r4$+r5$
        open"bitmap.txt" for output as#1
        w$=word$(bmp$,1,";")
         c=wcnt(w$,","):r=wcnt(bmp$,";")

       FOR i=1 to r
            w$=word$(bmp$,i,";")
           FOR j=1 to c
                e$=word$(w$,j,",")
                if e$="0" then l$=l$+" "+"," else l$=l$+"*"+","
           NEXT
            l$=l$+";"
       NEXT

             FOR i=1 to r
           FOR j=1 to c
                b$=b$+word$(word$(l$,i,";"),j,",")
           NEXT
            print b$
            print#1,b$
            b$=""
       NEXT
       print
       print
        print#1,""
        print#1,""
       FOR i=1 to 4
            w$=word$(fun$(l$,i),1,";")
            c=wcnt(w$,","):r=wcnt(fun$(l$,i),";")
           FOR j=1 to r
                b$=""
               FOR k=1 to c
                    b$=b$+word$(word$(fun$(l$,i),j,";"),k,",")
               NEXT
                print b$
                print#1,b$
           NEXT
            print
            print
            print#1,""
            print#1,""
       NEXT
        close#1
       FUNCTION fun$(m$,n)
            if n=1 then fun$=rota$(m$)
            if n=2 then fun$=rotc$(m$)
            if n=3 then fun$=fliptb$(m$)
            if n=4 then fun$=fliplr$(m$)
       END function
       FUNCTION rota$(m$)
            w$=word$(m$,1,";")
            c=wcnt(w$,","):r=wcnt(m$,";")
           FOR i=1 to c
               FOR j=1 to r
                    t$=t$+word$(word$(m$,r+1-j,";"),i,",")+","
               NEXT
                t$=t$+";"
           NEXT
            rota$=t$
       END function

       FUNCTION rotc$(m$)
            w$=word$(m$,1,";")
            c=wcnt(w$,","):r=wcnt(m$,";")
           FOR i=c to 1 step-1
               FOR j=r to 1 step-1
                    t$=t$+word$(word$(m$,r+1-j,";"),i,",")+","
               NEXT
                t$=t$+";"
           NEXT
            rotc$=t$
       END function
        ' flip top to bott
       FUNCTION fliptb$(m$)
            r=wcnt(m$,";")
           FOR i=r to 1 step-1
                t$=t$+word$(m$,i,";")+";"
           NEXT
            fliptb$=t$
       END function
        'flip left to right
       FUNCTION fliplr$(m$)
            w$=word$(m$,1,";")
            c=wcnt(w$,","):r=wcnt(m$,";")
           FOR i=1 to r
               FOR j=c to 1 step-1
                    t$=t$+word$(word$(m$,i,";"),j,",")+","
               NEXT
                t$=t$+";"
           NEXT
            fliplr$=t$
       END function
       FUNCTION wcnt(m$,de$)
           WHILE word$(m$,wc+1,de$)<>""
                wc=wc+1
           WEND
            wcnt=wc
       END function
 
User IP Logged

http://befs.in/
Facundo
Board Moderator


member is offline

Avatar




PM

Gender: Male
Posts: 1257
xx Re: a kind of bit map to main window & text file
« Reply #1 on: Mar 26th, 2017, 5:46pm »

Looks like something you could use on a Tetris like game.
User IP Logged

cundo aka MSlayer
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls