braille

Algemene discussies en vragen omtrent Liberty BASIC programma's. Stuur zoveel mogelijk delen van listings (snippets) in als je hulp wilt.

Moderators: anthonio, Abcott

braille

Berichtdoor bluatigro » di nov 25, 2014 1:07 pm

dit is een program dat baille laat zien
er zijn 2 soorten braille 6 dot en 8 dot
8 dot is gestanaariseerd
6 dot hangt van de taal af
als voorbeeld heb ik de nederlanse en de Esperanto versie ingebouwd
engels is byna het zelfde als nederlands
byna elke toets op het toetsenbord is gecodeerd in 8 dot
Code: Selecteer alles
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
nomainwin
open "braille 6 or 8" for graphics as #m
  #m "trapclose [quit]"
  #m "fill black"
  txt$="the quick brouwn fox jumped"
  call braille6 0,0,txt$,4,"blue","yellow","nl"
  txt$="over the lazy dog ."
  call braille6 0,50,txt$,4,"blue","yellow","nl"
  txt$="abcCdefgGhHijJklmnoprsStuUv"
  call braille6 0,100,txt$,4,"blue","yellow","esp"

  txt$="The quick brouwn fox"
  call braille8 0,150,txt$,4,"blue","yellow"
  txt$="jumped over the layzie dog ."
  call braille8 0,150+4*15,txt$,4,"blue","yellow"
  txt$="pi = 3.141592653589793238462643"
  call braille8 0,150+8*15,txt$,4,"blue","yellow"

wait
[quit]
  close #m
end
sub braille8 x,y,txt$,size,kl1$,kl2$
''also known as computer-braille this a fixed code
''       0123456789abcdef
code$ = " ae i)u oy   [  " _''0
      + " AE I U OY    _ " _''1
      + ".bf l v rz>   \ " _''2
      + " BF L V RZ      " _''3
      + ";cg m w s     | " _''4
      + "(CG$M W S       " _''5
      + ":  %j p         " _''6
      + "!   J P         " _''7
      + ",dh n x t  {  / " _''8
      + "'DH N X T     & " _''9
      + "  <             " _''a
      + " @~ k   }       " _''b
      + "  `     q   #   " _''c
      + "]               " _''d
      + "                " _''e
      + "084*2+6=195/3-7 " _''f
''       0123456789abcdef
  for i = 1 to len( txt$ )
    #m "goto ";x+i*size*10;" ";y
    #m "color ";kl1$
    #m "backcolor ";kl1$
    #m "down"
    #m "boxfilled ";x+i*size*10+size*7 _
    ;" ";y+size*13
    #m "up"
    #m "color ";kl2$
    #m "backcolor ";kl2$
    l$ = mid$( txt$,i,1)
    q = instr( code$ , l$ ) - 1
    if l$ = " " then q = 128
    for a = 0 to 1
      for b = 0 to 3
        if q and 2^((a*4)+b) then
        #m "goto ";x+i*size*10+(a*size*3+3*size) _
        ;" ";y+b*size*3+size
        #m "down"
        #m "boxfilled ";x+i*size*10 _
        +(a*size*3+size) _
        ;" ";y+b*size*3+size*3
        #m "up"
        end if
      next b
    next a
  next i
end sub
sub braille6 x,y,txt$,size,kl1$,kl2$,t$
  select case t$
  case "nl" ''dutch
      '' 0123456701234567012345670123456701234567012345670123456701234567
  code$=" a,b k;l cif/msp e:h*o!r djgäntq  ? _u(v  öë xèç  .ü)z    wï y é"
  case else ''esperato CGHJSU = cx gx etc...
  code$=" a,b k;l cif/msp e:h*o!r djg nt   ? _u(v C HU S   . )z    JG    "
  kl1$ = "0 64 0"
  kl2$ = "green"
  end select
  for i = 1 to len( txt$ )
    #m "goto ";x+i*size*10;" ";y
    #m "color ";kl1$
    #m "backcolor ";kl1$
    #m "down"
    #m "boxfilled ";x+i*size*10+size*7 _
    ;" ";y+size*11
    #m "up"
    #m "color ";kl2$
    #m "backcolor ";kl2$
    l$ = mid$( txt$,i,1)
    q = instr( code$ , l$ ) - 1
    for a = 0 to 1
      for b = 0 to 2
        if q and 2^((a*3)+b) then
        #m "goto ";x+i*size*10+(a*size*3+3*size) _
        ;" ";y+b*size*3+size
        #m "down"
        #m "boxfilled ";x+i*size*10 _
        +(a*size*3+size) _
        ;" ";y+b*size*3+size*3
        #m "up"
        end if
      next b
    next a
  next i
end sub
bluatigro
 
Berichten: 306
Geregistreerd: za sep 27, 2008 6:01 pm

Keer terug naar Liberty BASIC Code

Wie is er online

Gebruikers op dit forum: Geen geregistreerde gebruikers. en 1 gast

cron