Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ten lines (Collection)
#1
'Program multiplication simple
'lrcvs
'(MU) Spain
'13 Jan 2010

'This program is based on: a * b = c >>> a = c / X

CLS

a$ = "9876543298789"
b$ = "2468013"

'a * b

la = LEN(a$) + LEN(b$)
c$ = STRING$(la, "0")

FOR r = 1 TO la
FOR s = 0 TO 9
MID$(c$, r) = LTRIM$(STR$(s))
v$ = LTRIM$(STR$(VAL(c$) / VAL(b$)))
IF v$ = a$ THEN PRINT "Program = "; VAL(c$): PRINT : PRINT "Computer = "; VAL(a$) * VAL(b$): END
IF VAL(a$) < VAL(v$) THEN MID$(c$, r) = LTRIM$(STR$(s - 1)): EXIT FOR
NEXT s
NEXT r
SLEEP
END

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

'Program arithmetic division with integers numbers
'lrcvs
'(MU) Spain
'09 Jan 2010

CLS
a$ = "9876598743014313"
b$ = "388798006"

'A/B

la = LEN(a$)
c$ = STRING$(la, "0")

FOR r = 1 TO la
    FOR s = 0 TO 9
    MID$(c$, r) = LTRIM$(STR$(s))
    v$ = LTRIM$(STR$(VAL(c$) * VAL(b$)))
    IF VAL(v$) = VAL(a$) THEN PRINT v$: EXIT FOR
    IF VAL(a$) < VAL(v$) THEN MID$(c$, r) = LTRIM$(STR$(s - 1)): EXIT FOR
    NEXT s
NEXT r

r$ = LTRIM$(STR$(VAL(a$) - (VAL(c$) * VAL(b$))))
d$ = LTRIM$(STR$(VAL(r$) / VAL(b$)))

PRINT "Program = "; LTRIM$(STR$(VAL(c$))) + " . " + RIGHT$(d$, LEN(d$) - 1)
PRINT
PRINT "Remanence = "; r$
PRINT
PRINT "Computer = "; VAL(a$) / VAL(b$)
SLEEP
END

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

'Program square root
'lrcvs
'(MU) Spain
'12 Jan 2010

CLS

'a$ = number to square root

a$ = "25521342100008787"

la = INT(LEN(a$) / 2) + 1
c$ = STRING$(la, "0")
FOR r = 1 TO la
    FOR s = 0 TO 9
    MID$(c$, r) = LTRIM$(STR$(s))
    v$ = LTRIM$(STR$(VAL(c$) * VAL(c$)))
    IF VAL(a$) < VAL(v$) THEN MID$(c$, r) = LTRIM$(STR$(s - 1)): EXIT FOR
    NEXT s
NEXT r

t$ = LTRIM$(STR$(VAL(a$) - (VAL(c$) * VAL(c$))))
d$ = LTRIM$(STR$(VAL(t$) / (VAL(c$)) / 2))

PRINT "Square root of = "; a$
PRINT
PRINT "Program = "; LTRIM$(STR$(VAL(c$))) + " . " + RIGHT$(d$, LEN(d$) - 1)
PRINT
PRINT "Remanence = "; t$
PRINT
PRINT "Computer = "; SQR(VAL(a$))
SLEEP
END

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Reply
#2
Ya Its A One Of The Best And Simple Method For It I Am Also Want To Follow It But Its Did Creted By You Is The Same Thin Which I Want To Create So Good And Nice
Reply
#3
Thank you for your good opinion.!

This program is free, use it well.

It was fun doing this program, I hope you like.

Greetings!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)