Jump to content

Recommended Posts

BBC BASIC seems to be the most structured so i'm using that one for now. When I'm not working on that, i'll keep refining the story. My focus will be completely on the game for a good while. I don't want to rush this. Wish me luck

 

I can't send the game for whatever reason, apparently SSD files on Beebem can't be read by AA or I'm wrong

Link to comment
https://forums.atariage.com/topic/331536-the-reborn-wip-for-bbc-micro/
Share on other sites

Since I can't post the SSD, here is the code

L.
   10 PRINT "WHEN THE WORLD WAS DESTROYED, WE HID IN THE CAVES. OUR STORY IS ONE OF TRAGEDY. WE ARE"
   20 COLOUR 2:PRINT "THE REBORN"
   30 INPUT A$
   31 CLS
   32 MODE 1
   40 PRINT "IT BEGAN IN THE YEAR OF OUR LORD 2166 THAT THE WORLD GOVERNMENTS DECIDED ON A NEW COURSE OF ACTION. I WAS OUTSIDE THE AREA DOING MY ROUNDS"
   41 INPUT A$
   42 PRINT "YOU ARE NEAR A BUILDING, IN FRONT OF THE BUILDING IS A DOOR. THE SIGN READS"
   43 PRINT "RECRUITERS OFFICE:ADMITTANCE ALLOWED ONLY BY LEGION GENERALS"
   44 PRINT "WHAT DO YOU WANT TO DO?"
   45 INPUT A$
   46 IF A$="PICK LOCK" THEN GOTO 50:IF A$="KICK IN THE DOOR" THEN GOTO 60:IF A$="FIND A WAY AROUND" THEN GOTO 66
   47 CLS
   48 COLOUR 3:PRINT "THE WIND IS COLD"
   50 PRINT "YOU PICK THE LOCK AND HEAD INSIDE. THE ROOM IS WELL LIT AND THERE ARE TABLES WITH FINE MEATS. THE GUESTS NOTE YOUR PRESENCE WITH SCORN"
   60 MODE 0
   61 PRINT "IGNORING THE LOCALS, YOU HEAD UP TO THE OFFICE AND HIDE IN THE CLOSET"
   62 PRINT "YOU HOLD YOUR BREATH"
   63 FOR B=1 TO 3:NEXT B:IF B<1 THEN PRINT "YOU LET OUT A BREATH AND THE GUARDS HEAR YOU. YOU ARE SHOT AND KILLED":STOP
   64 IF B>3 THEN PRINT "YOU WAIT UNTIL THE GUARDS PASS AND LET OUT A SIGH. YOU HEAD UP TO THE OFFICE, SHOOT THE MAN IN CHARGE AND HIDE THE BODY"
   65 FOR X=1 TO 15:NEXT X:REM NUMBER OF SOLDIERS
   66 LET S=SIN(X*16):LET SOL=S^21
   67 PRINT "DO NOT LET THE SOLDIERS CALL FOR REINFORCEMENTS"
   68 PRINT "YOU NEED TO BE CAREFUL"
   69 PRINT "REMMEBER: NORTH, EAST, NORTH SOUTH NORTH WEST"
   70 INPUT A$
   71 CLS
   72 PRINT "DEFINE PATH":INPUT A$:IF A$<>"NENSNE"THEN PRINT "YOU ARE CAUGHT AND KILLED" ELSE PRINT "YOU MAKE IT OUT. THE SOLDIERS OUTSIDE ARE ON YOUR SIDE"
   73 PRINT "END OF PART 1"
>

  • 2 weeks later...
On 2/27/2022 at 10:14 PM, Frozone212 said:

46 IF A$="PICK LOCK" THEN GOTO 50:IF A$="KICK IN THE DOOR" THEN GOTO 60:IF A$="FIND A WAY AROUND" THEN GOTO 66

Remember that an IF statement always terminates the opposite condition unless you have an ELSE.

In this case it means that unless A$="PICK LOCK", the interpreter will move on to the next row.

Also if the condition is true, it jumps to line 50, so all subsequent IF statements are unreachable.

You might want to split those into three different lines and renumber your lines so all lines are reachable.

 

This is true on every computer with BASIC (or for that matter any programming language).

It is also why IF statements are considered "expensive" in e.g. the BASIC10Liners competition, because an IF effectively means nothing else can follow.

On 2/27/2022 at 10:14 PM, Frozone212 said:

63 FOR B=1 TO 3:NEXT B:IF B<1 THEN PRINT "YOU LET OUT A BREATH AND THE GUARDS HEAR YOU. YOU ARE SHOT AND KILLED":STOP
64 IF B>3 THEN PRINT "YOU WAIT UNTIL THE GUARDS PASS AND LET OUT A SIGH. YOU HEAD UP TO THE OFFICE, SHOOT THE MAN IN CHARGE AND HIDE THE BODY"

In this case B will always equal 4, because the loop runs until B=3 and then one final NEXT. It means that the IF statement on line 63 always will yield false, and the IF statement on line 64 always yields true. There is no variation or user input in how you can reach these different states.

On 2/27/2022 at 10:14 PM, Frozone212 said:

65 FOR X=1 TO 15:NEXT X:REM NUMBER OF SOLDIERS

Same about this one, X will always be 16 because it loops from 1 to 15 and then one final one.

On 2/27/2022 at 10:14 PM, Frozone212 said:

 66 LET S=SIN(X*16):LET SOL=S^21

This one is curious. You take the sinus of 16*16 = 256.

 

BBC BASIC actually has two functions RAD(X) which returns number of radians from a number of degrees in X, and vice versa DEG(X) which returns number of degrees from a number of radians in X. Try the later on DEG(PI) and you will get 180.

 

SIN is defined between 0 and 2*PI radians (or 0 and 359 degrees). Interestingly, 256 - 40*2*PI equals 4.672 radians which is close to 270 degrees. It goes without saying that 256 itself is close to 270 degrees.

 

Essentially SIN will in this case return a number very close to -1, either you get -0.999208034 if you treat 256 as radians, or -0.970295726 if you treat the input as degrees.

 

SIN(256) ^ 21 = -0.9835

SIN(RAD(256)) ^ 21 = -0.531

 

and there are your soldiers. Either they're almost -1 or they're just above -0.5.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...