ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 lines
891 B

  1. 100 REM Purpose: Verify MATCH command
  2. 110 REM Author: Howard Wulf, AF5NE
  3. 120 REM Date: 2015-12-25
  4. 130 REM
  5. 1000 REM --------------------------------------
  6. 1010 READ Test.Case.Number
  7. 1020 IF Test.Case.Number < 0 THEN 2000
  8. 1030 READ A$, B$, I%, N%
  9. 1040 PRINT "TEST CASE #" ; Test.Case.Number ; ": ";
  10. 1050 PRINT "A$=[";A$;"], B$=[";B$;"], I%=";I%;", N%=";N%
  11. 1060 J% = MATCH( A$, B$, I% )
  12. 1070 IF J% = N% THEN 1000
  13. 1100 PRINT "TEST FAILED"
  14. 1110 GOTO 9999
  15. 2000 PRINT "TEST PASSED"
  16. 2010 GOTO 9999
  17. 8000 REM Test #, A$, B$, I%, N
  18. 8010 DATA 1, "is", "Now is the", 1, 5
  19. 8020 DATA 2, "##", "October 8, 1876", 1, 12
  20. 8030 DATA 3, "a?", "character", 4, 5
  21. 8040 DATA 4, "\#", "123#45", 1, 4
  22. 8050 DATA 5, "ABCD", "ABC", 1, 0
  23. 8060 DATA 6, "\#1\\\?", "1#1\?2#", 1, 2
  24. 8070 DATA 7, " ", " ", 2, 0
  25. 8080 DATA 8, " ", "", 1, 0
  26. 8090 DATA 9, "", " ", 1, 1
  27. 8100 DATA 10, "", "", 1, 0
  28. 8110 DATA -1
  29. 9999 END