-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathARPAN_OS.BAS
More file actions
607 lines (578 loc) · 19.4 KB
/
ARPAN_OS.BAS
File metadata and controls
607 lines (578 loc) · 19.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
DECLARE SUB plotter ()
DECLARE SUB converter ()
DECLARE SUB con ()
DECLARE SUB calculator ()
DECLARE SUB millos ()
DECLARE SUB boot ()
DECLARE SUB desktop ()
DECLARE SUB table ()
DECLARE SUB finder ()
DECLARE SUB clock ()
DECLARE SUB pic ()
DECLARE SUB tex ()
DECLARE SUB mus ()
DECLARE SUB delay (seconds!)
DECLARE SUB diresw ()
CLS
_TITLE "Arpan OS [V 1.0.5.0]"
COLOR 12&: PRINT "SELECT ArpanOS SCREEN SETTINGS :-"
PRINT
COLOR 8&: PRINT "1) DISABLE WINDOWS AND FULLSCREEN MODE"
COLOR 7&: PRINT "2) Windowed"
COLOR 15&: PRINT "3) EXIT"
PRINT
COLOR 10&: PRINT "NOTE - Option 1 only disables your windows for our OS but DOES NOT DELETE IT! If you want to return to windows then click ALT + ENTER 4 times"
PRINT
COLOR 5&: PRINT "This OS is totally safe!"
COLOR 15&: INPUT "Your choice? - ", zcv
SELECT CASE zcv
CASE 1
$RESIZE:ON
_FULLSCREEN
_MOUSEHIDE
CASE 2
$RESIZE:ON
_MOUSESHOW
CASE 3
END
END SELECT
SCREEN 9
CLS
COLOR 10&, 8&
_FONT _LOADFONT("C:\windows\fonts\verdana.ttf", 13)
PRINT "Welcome to ARPAN OS Version 1.0.5.0!"
PRINT "(Made on QB64) --> By - Arpan Chatterjee @2020"
PRINT "Please read the <README FIRST!> file to know password and other things...."
passq$ = "1647"
INPUT "Enter password - ", passq$
SELECT CASE passq$
CASE IS = "1647"
DO
DIM SHARED owner AS STRING
INPUT "Please enter your name - ", owner
INPUT "Select operating system boot option --> safe,normal or shut down - ", OS$
IF OS$ = "safe" THEN
CLS
CALL boot
ELSEIF OS$ = "normal" THEN
CLS
CALL load
CALL boot
ELSEIF OS$ = "shut down" THEN
END
ELSE PRINT "Not correct! Try again."
END IF
INPUT "Do you want to try again? y or n - ", reply$
LOOP UNTIL reply$ = "n"
CASE ELSE
PLAY "a a a a"
PRINT "Wrong Password. Calling Shutdown #ERR CODE - 127A"
END SELECT
END
SUB boot ()
PRINT "Processing commands ..."
SLEEP 3
INPUT "press any key", az
CLS
PRINT " Starting OS... "
PRINT
PRINT " ArpanOS v 1.0.5.0 "
PRINT " Or Arpstar CenturonOS "
PRINT " ---------------------- "
PRINT
INPUT "100% loaded.Press any key", az
CALL desktop
END SUB
SUB calculator ()
DO
REM Calculator
CLS
PLAY "a12 c16 v56 c47"
PRINT "Calculator [V 5.2]"
PRINT "note - operation codes ---> + , - , * , /, %"
DIM a AS INTEGER
DIM b AS INTEGER
INPUT "number 1 = ", a
INPUT "number 2 = ", b
INPUT "operation = ", c$
SELECT CASE c$
CASE "+"
PLAY "a12 c16 v56 c47 a12"
PRINT a; "+"; b; "="; a + b
CASE "-"
PLAY "a12 c16 v56 c47 a12"
PRINT a; "-"; b; "="; a - b
CASE "*"
PLAY "a12 c16 v56 c47 a12"
PRINT a; "*"; b; "="; a * b
CASE "/"
PLAY "a12 c16 v56 c47 a12"
PRINT a; "/"; b; "="; a / b
CASE "%"
PLAY "a12 c16 v56 c47 a12"
PRINT a; "/"; b; "* 100 ="; a / b * 100; "%"
CASE ELSE
PLAY "a,a,a"
PRINT "Wrong input!"
PRINT "Please input + , - , * , / or %"
END SELECT
INPUT "Repeat ? (y or n) --->", z$
LOOP UNTIL z$ = "n"
CLS
PRINT "Thanks for using calculator!"
END SUB
SUB con ()
DO
CLS
PLAY "aacaa ac"
PRINT "Conver on [v1.1]"
INPUT "distance,speed or time?-", a$
SELECT CASE a$
CASE IS = "distance"
INPUT "input distance in m-", b
PRINT b; "m ="; b / 10; "dam"
PRINT b; "m ="; b / 100; "hm"
PRINT b; "m ="; b / 1000; "km"
INPUT "press a key", az
CLS
INPUT "input distance in mm", c
PRINT c; "mm ="; c / 10; "cm"
PRINT c; "mm ="; c / 100; "dm"
PRINT c; "mm ="; c / 1000; "m"
CASE IS = "speed"
INPUT "km/hr-", d
PRINT d; "km/hr ="; d * 1000 / 60; "m/min"
PRINT d; "km/hr ="; d * 1000 / 3600; "m/s"
INPUT "m/s or m/min?-", e$
IF e$ = "m/s" THEN
INPUT "m/s-", e
PRINT e; "m/s ="; e / 1000 / 1 / 3600; "km/hr"
PRINT e; "m/s ="; e / 1 / 60; "m/min"
ELSEIF e$ = "m/min" THEN
INPUT "m/min-", f
PRINT f; "m/min ="; f / 1000 / 1 / 3600; "km/hr"
PRINT f; "m/min ="; f / 60; "m/s"
END IF
CASE IS = "time"
INPUT "hours-", g
PRINT g; "hours ="; g * 60; "min"
PRINT g; "hours ="; g * 3600; "sec"
INPUT "press a key", az
CLS
INPUT "sec or min?", g$
IF g$ = "sec" THEN
INPUT "sec-", h
PRINT h; "sec ="; h / 60; "min"
PRINT h; "sec ="; h / 3600; "hours"
ELSEIF g$ = "min" THEN
INPUT "min-", i
PRINT i; "min ="; i / 60; "hours"
PRINT i; "min ="; i * 60; "sec"
END IF
END SELECT
INPUT "Do you want to repeat? y or n", k$
LOOP UNTIL k$ = "n"
CLS
PRINT "Thanks for using conver on!"
END SUB
SUB converter ()
CLS
PRINT "Conver on [v1.1]"
INPUT "enter password-", q
IF q = 1647 THEN
CALL con
ELSE PRINT "Wrong password!"
PLAY "aaaa"
END IF
END SUB
SUB desktop ()
CLS
CALL millos
END SUB
SUB millos ()
PLAY "f36 c45 e12"
PRINT "CUI screen"
PRINT "COMMANDS - dir, cls, calculator, converter, plotter, tables, finder, clock, picviewer, text editor, stopwatch, music player, exit, comp info, dirchange"
DO
INPUT "COMMAND -> ", com$
SELECT CASE com$
CASE "dir"
PRINT "COMP INFO,CALCULATOR,CONVERTER,FINDER,PLOTTER,STOPWATCH,TABLES,CLOCK,PICVIEWER,TEXT EDITOR,MUSIC PLAYER,DIRCHANGE"
CASE "calculator"
CALL calculator
CASE "converter"
CALL converter
CASE "setting"
CALL desktop
CASE "comp info"
DO
CLS
LOCATE 1, 80: COLOR 2&: PRINT "ArpanOS [V 1.0.5.0]"
PRINT
COLOR 6&: PRINT "This copy of ArpanOS (CENTURON OS) is registered to - "; owner
PRINT
PRINT "Thanks for installing ArpanOS (CENTURON OS)"
PRINT
PRINT "OS RUNNING SYSTEM TIME = "; TIME$
PRINT "OS SYSTEM DATE = "; DATE$
PRINT
PRINT "Press any key"
_DISPLAY
_LIMIT 1
LOOP UNTIL INKEY$ <> ""
PRINT
COLOR 15&: INPUT "D you want to change any settings? - y or n = ", sett$
IF sett$ = "y" THEN
CLS
PRINT "******************************"
PRINT
INPUT "Enter new username - ", owner
PRINT "OK. Username is changed!"
PRINT "New user name - "; owner
PRINT
PRINT "******************************"
END IF
PRINT "Now exiting comp info"
INPUT "Press any key", zzzx$
CLS
COLOR 10&, 8&
CASE "plotter"
CALL plotter
CASE "tables"
CALL table
CASE "finder"
CALL finder
CASE "clock"
CALL clock
CASE "picviewer"
CALL pic
CASE "text editor"
CALL tex
CASE "music player"
CALL mus
CASE "dirchange"
CALL diresw
CASE "stopwatch"
CALL stpw
CASE "cls"
CLS
CASE "exit"
PRINT "Please wait..."
SLEEP 2
CLS
PLAY "a12 c34 d45 e10"
PRINT "ACKNOWLEDGEMENT (Please read it!) -> Thanks for using our OS.If you see any bug then please inform us at our website - www.aicpl.com OR mail at - arpanchatterjee1647@gmail.com. The maker of this operating system is Arpan Chatterjee."
INPUT "Press any key", az
CASE ELSE
BEEP
PRINT "Wrong input.Please try again."
END SELECT
LOOP UNTIL com$ = "exit"
END SUB
SUB plotter ()
' Values for keys on the numeric keypad and the spacebar:
CONST UP = 72, DOWN = 80, LFT = 75, RGHT = 77
CONST UPLFT = 71, UPRGHT = 73, DOWNLFT = 79, DOWNRGHT = 81
CONST SPACEBAR = " "
' Null$ is the first character of the two-character INKEY$
' value returned for direction keys such as UP and DOWN:
Null$ = CHR$(0)
' Plot$ = "" means draw lines; Plot$ = "B" means
' move graphics cursor, but don't draw lines:
Plot$ = ""
CLS
PRINT "Welcome to centuron plotter draw!"
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT "Use the cursor movement keys to draw lines."
PRINT "Press spacebar to toggle line drawing on and off."
PRINT "Press <ENTER> to begin. Press q to end the program."
DO: LOOP WHILE INKEY$ = ""
SCREEN 1
DO
SELECT CASE KeyVal$
CASE Null$ + CHR$(UP)
DRAW Plot$ + "C1 U2"
CASE Null$ + CHR$(DOWN)
DRAW Plot$ + "C1 D2"
CASE Null$ + CHR$(LFT)
DRAW Plot$ + "C2 L2"
CASE Null$ + CHR$(RGHT)
DRAW Plot$ + "C2 R2"
CASE Null$ + CHR$(UPLFT)
DRAW Plot$ + "C3 H2"
CASE Null$ + CHR$(UPRGHT)
DRAW Plot$ + "C3 E2"
CASE Null$ + CHR$(DOWNLFT)
DRAW Plot$ + "C3 G2"
CASE Null$ + CHR$(DOWNRGHT)
DRAW Plot$ + "C3 F2"
CASE SPACEBAR
IF Plot$ = "" THEN Plot$ = "B " ELSE Plot$ = ""
CASE ELSE
' The user pressed some key other than one of the
' direction keys, the spacebar, or "q," so
' don't do anything.
END SELECT
KeyVal$ = INKEY$
LOOP UNTIL KeyVal$ = "q"
SCREEN 9 ' Restore the screen to 80-column
COLOR 10&, 8& ' text mode and end.
_FONT _LOADFONT("C:\windows\fonts\verdana.ttf", 13)
CLS
END SUB
SUB table
DO
CLS
INPUT "Table of=", a
PRINT a; "x 1 ="; a * 1
PRINT a; "x 2 ="; a * 2
PRINT a; "x 3 ="; a * 3
PRINT a; "x 4 ="; a * 4
PRINT a; "x 5 ="; a * 5
PRINT a; "x 6 ="; a * 6
PRINT a; "x 7 ="; a * 7
PRINT a; "x 8 ="; a * 8
PRINT a; "x 9 ="; a * 9
PRINT a; "x 10 ="; a * 10
INPUT "Do you want to end? (y or n)", x$
LOOP UNTIL x$ = "y"
END SUB
SUB finder
DO
CLS
PLAY "e24 a19 b33 d10"
PRINT "WELCOME TO FINDER (AREA and PERIMETER)! (V1.0.0.0)"
PRINT "Note - no units supported.Use only numbers."
INPUT "Area or perimeter? ", sub$
SELECT CASE sub$
CASE "area"
DO
INPUT "Which shape? (rectangle, square, triangle) - ", shape$
IF shape$ = "rectangle" THEN
INPUT "Length - ", length
INPUT "Breadth - ", breadth
PRINT "Rectangle area ="; length * breadth
ELSEIF shape$ = "square" THEN
INPUT "Side size - ", side
PRINT "Square area ="; 2 * side
ELSEIF shape$ = "triangle" THEN
INPUT "Base = ", bas
INPUT "Height = ", height
PRINT "Triangle area ="; 1 / 2 * bas * height
ELSE PRINT "Shape not supported! Try another shape."
END IF
INPUT "Do you want to try again? y or n - ", ans$
LOOP UNTIL ans$ = "n"
CASE "perimeter"
DO
INPUT "Which shape? (rectangle, square, triangle, regular polygon) - ", shape$
IF shape$ = "rectangle" THEN
INPUT "Length - ", length
INPUT "Breadth - ", breadth
PRINT "Perimeter of rectangle ="; 2 * (length + breadth)
ELSEIF shape$ = "square" THEN
INPUT "Side size - ", side
PRINT "Square perimeter ="; 4 * side
ELSEIF shape$ = "triangle" THEN
INPUT "Side size - ", side
PRINT "Triangle perimeter ="; 3 * side
ELSEIF shape$ = "regular polygon" THEN
INPUT "No. of sides - ", no
INPUT "Side size - ", side
PRINT "Polygon perimeter ="; no * side
ELSE PRINT "Shape not supported! Try another shape."
END IF
INPUT "Do you want to try again? y or n - ", ans$
LOOP UNTIL ans$ = "n"
END SELECT
INPUT "Do you want to repeat? y or n - ", end$
LOOP UNTIL end$ = "n"
END SUB
SUB clock
DO
CLS
PRINT "CLOCK (24-HOUR FORMAT)"
PRINT "TIME - "; TIME$
PRINT "DATE - "; DATE$
PRINT "Press esc to exit"
_DISPLAY
_LIMIT 1
LOOP UNTIL INKEY$ = CHR$(27)
END SUB
SUB pic
DO
CLS
_TITLE "Picviewer [V 1.5.0.0]"
SCREEN _NEWIMAGE(1450, 550, 32)
CLS , _RGB(0, 0, 0)
INPUT "Enter directory - ", di$
CHDIR di$
INPUT "Enter name of picture (extension to be added) (.jpg, .bmp and .png files supported) - ", a$
i = _LOADIMAGE(a$)
_PUTIMAGE (0, 0), i
INPUT "Do you want to repeat? y or n - ", rep$
LOOP UNTIL rep$ = "n"
SCREEN 9
a& = _LOADFONT("C:\windows\fonts\verdana.ttf", 13)
_FONT a&
COLOR 10&, 8&
END SUB
SUB tex
DO
CLS
_TITLE "Text editor"
INPUT "Enter directory - ", di$
CHDIR di$
INPUT "Enter new or existing filename(With extension) - ", na$
OPEN na$ FOR OUTPUT AS #1
INPUT "Edit text here - ", te$
PRINT #1, te$
PRINT "Your file has been edited!"
PRINT "Find your file at"; di$
INPUT "Do you want to try again? y or n - ", kl$
LOOP UNTIL kl$ = "n"
END SUB
SUB mus
CLS
_TITLE "Music player"
PRINT "Welcome to Music player! [V 1.0.0.0]"
INPUT "Enter directory - ", dires$
CHDIR dires$
INPUT "Please enter name of song (with extension) (in the current directory only) - ", a$
h& = _SNDOPEN(a$)
INPUT "Are you ready to play? press s to stop , p to pause , e to exit and r to resume - y or n? = ", opi$
_SNDPLAY (h&)
DO
s$ = INKEY$
SELECT CASE s$
CASE "s"
_SNDSTOP (h&)
CASE "p"
_SNDPAUSE (h&)
CASE "r"
_SNDPLAY (h&)
CASE "e"
CLS
EXIT DO
END SELECT
LOOP
END SUB
SUB delay
DO WHILE azx = 0
_DELAY 0.5
LOOP
END SUB
SUB load
LOCATE 1, 1
PRINT "ArpanOS [V 1.0.5.0]"
PRINT "Press Enter key"
PRINT "After pressing the key, please wait for some time until the OS is loaded on memory.This WILL NOT ERASE your existing OS."
DO WHILE INKEY$ = ""
LOOP
CLS
SCREEN 12
LOCATE 10, 33
PRINT "LOADING...."
LOCATE 11, 23: PRINT "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
LOCATE 12, 23: PRINT "º º"
LOCATE 13, 23: PRINT "ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"
FOR loading = 1 TO 30
TEXT$ = TEXT$ + "±"
LOCATE 12, 24: PRINT TEXT$
s = s + 3
IF s = 90 THEN
s = 100
END IF
LOCATE 14, 32: PRINT s; "% LOADED"
_DELAY INT(RND * 3)
NEXT loading
LOCATE 2, 1
PRINT "PROGRAM LOADED TO MEMORY = SUCCESS!"
INPUT "Press any key", anykey$
SCREEN 9
COLOR 10&, 8&
_FONT _LOADFONT("C:\windows\fonts\verdana.ttf", 13)
END SUB
SUB diresw
INPUT "Enter directory - ", dirts$
CHDIR dirts$
END SUB
SUB stpw
REM A stopwatch with alarm
CLS
PRINT "STOPWATCH WITH ALARM"
INPUT "Enter what do you want - 1 - Timer or 2 - Stopwatch = ", deco
CLS
IF deco = 1 THEN
INPUT "Enter for how many seconds you want the timer = ", uset
DO
CLS
LET sec = sec + 1
PRINT "Watch ="; day; "Days"; hou; "Hours"; mins; "Minutes"; sec; "Seconds"
PRINT "Or"
PRINT " TIMER"
PRINT " *********"
PRINT USING " | ##:##:## |"; hou; mins; sec
PRINT " *********"
PRINT
PRINT "System time = "; TIME$
IF sec = 60 THEN
mins = mins + 1
sec = 0
ELSEIF mins = 60 THEN
hou = hou + 1
ELSEIF hou = 24 THEN
day = day + 1
END IF
_DELAY 1
LOOP UNTIL sec = uset
IF sec = uset THEN
DO
CLS
PRINT sec; "seconds over!"
PRINT "Press any key"
BEEP
_DISPLAY
_LIMIT 1
LOOP UNTIL INKEY$ <> ""
END IF
PRINT "FACTS - This timer is 0.001 millisecond accurate!"
INPUT "Press any key", zzzx$
ELSEIF deco = 2 THEN
DO
CLS
LET milli = milli + 1
PRINT USING "Stopwatch - ##:##:##:##"; hour; minutes; seconds; milli
PRINT
PRINT "Press any key"
IF milli = 9 THEN
seconds = seconds + 1
milli = 1
ELSEIF seconds = 59 THEN
minutes = minutes + 1
seconds = 0
ELSEIF minutes = 60 THEN
hour = hour + 1
END IF
_DELAY 0.1
LOOP UNTIL INKEY$ <> ""
CLS
PRINT "The ending time was -"; hour; ":"; minutes; ":"; seconds; ":"; milli
END IF
END SUB