بر روی کارکتر ورودی عمل شیفت را انجام می دهد
CLS
DIM a AS STRING
DIM b(100) AS INTEGER
INPUT "enter a string ..."; a$
INPUT "how many shift..."; x
k = LEN(a$)
FOR i = 1 TO k
temp = ASC(MID$(a$, i, 1))
FOR j = 0 TO 7 STEP 1
b(8 * i - j) = temp MOD 2
temp = temp 2
NEXT j
NEXT i
FOR d = 8 * k TO 1 STEP -1
b(d + x) = b(d)
NEXT d
FOR q = 1 TO x
b(q) = 0
NEXT q
FOR i = 1 TO k
ar = 1
FOR j = 8 * i TO 8 * (i - 1) + 1 STEP -1
tempk = tempk + ar * b(j)
ar = ar * 2
NEXT j
PRINT CHR$(tempk),
tempk = 0
NEXT i