here is another small code converted from qb64
an epidemiology test or experiment over corona virus outbreak...
it very simple code
1. choose population size
2. each day passes infections doubles
3. after 1000 infections (sickness cases) people start to die by 3.4 % mortality each day
4. when infections reaches half or so of population program stops.
i guess i could have called it sadly "and they all got sick and... died..." but that's too simplistic and pessimistic and terrible :(
if i could i would write a program that will kick this corona virus a** and make it go away...
p.s. - one thing i found i tried to use unsigned integer 64 or ulongint but it wouldn't recognized so i used the suffix "ull" and that did the trick but i wonder why is it a bug in the compiler? (freebasic 32-bit 1.07 i think) i tried to finf the 64-bit compiler for freebasic but couldn't any one have an idea?...
Code: Select all
'_TITLE "CORONA VIRUS"
'DIM Shared As ULongInt
Dim Shared INFECTIONSull 'As unsigned Integer
Dim Shared DEATHSull 'As unsigned Integer
Dim Shared POPull 'As unsigned Integer
Dim Shared DAYS AS Integer
INFECTIONSull = 1
SUB cp (row, s$)
LOCATE row, (80 - LEN(s$)) / 2: PRINT s$
cp 2, "CORONA VIRUS"
cp 4, "A EXPERINENT IN EPIDEMIOLOGY"
cp 6, "PRESS ANY KEY TO CONTINUE"
LOOP UNTIL INKEY$ <> ""
LOCATE 5, 5
INPUT "ENTER POPULATION'S NUMBER: ", POPull
PRINT "DAY: " + STR$(DAYS)
PRINT "INFECTIONS: " + STR$(int(INFECTIONSull))
PRINT "DEATHS: " + STR$(Int(DEATHSull))
PRINT "POPULATION: " + STR$(Int(POPull - DEATHSull))
DAYS = DAYS + 1
INFECTIONSull = INFECTIONSull * 2
IF INFECTIONSull > 1000 THEN DEATHSull = INFECTIONSull * 34 / 1000
LOOP UNTIL INFECTIONSull > POPull
Print "press any key..."