Irfanview, QBasic items from the archives

qbasic

#1

Does anybody remember the viewer program Irfanview from back in the Win98 days? I think this image is from the startup screen, but can’t remember for sure. A friend dropped off a box of old discs and this was on one of them…

On a different note, here is a throwback to the old days… A QBasic program I called Golfer that is a spin on the old puzzle, Reversi.

REM
REM Golfer
REM Copyright 2001 mtf

OPTION BASE 1

DECLARE SUB CenterJustify ()
DECLARE SUB CopyMap ()
DECLARE SUB GetKey ()
DECLARE SUB InvertElements ()
DECLARE SUB IsInOrder ()
DECLARE SUB ParEvaluate ()
DECLARE SUB ShowOrder ()
DECLARE SUB Shuffle ()
DECLARE SUB Title ()

DIM SHARED Row(9) AS INTEGER, Invert AS INTEGER, InOrder AS INTEGER
DIM SHARED Param AS STRING, InParam AS INTEGER, Tee AS INTEGER
DIM SHARED Map(9) AS INTEGER, WriteLine AS STRING, TeePrompt AS STRING
DIM SHARED Players(4) AS STRING, Player AS INTEGER, ScoreCard(4) AS INTEGER
DIM SHARED Par AS INTEGER, OverUnder AS INTEGER, Sign AS STRING
DIM SHARED Colour AS INTEGER, KeyPress AS STRING
DIM SHARED xPos AS INTEGER, ypos AS INTEGER

CONST Penalty = 2
DO
  Colour = 7: Title
  CLEAR
  Player = 1
  WriteLine = "Ready to tee-up!       [Enter] = Begin"
   Colour = 7: ypos = 23: CenterJustify
   Param = CHR$(13): GetKey
  Tee = 3: Retry = 0
  DO
    TeePrompt = "Press [2.." + RIGHT$(STR$(Tee), 1) + "] to invert elements, or [Q] to quit."
    Par = Par + Tee
     Colour = 3: Title
     Colour = 3: ypos = 23: WriteLine = TeePrompt: CenterJustify
     Shuffle
     Colour = 6: ShowOrder
    Count = 0: Retry = 0
    DO
       Param = LEFT$("q23456789Q", Tee): GetKey
      IF InParam < 2 OR InParam > 9 THEN GOTO EndPrompt

      Count = Count + 1
       InvertElements
      IF Retry = 0 THEN Colour = 6 ELSE Colour = 7
       ShowOrder
      Colour = 3: ypos = 23
      WriteLine = "Number of swings this fairway:" + STR$(Count)
       CenterJustify
       IsInOrder
      IF Count < 2 * Tee - 1 THEN GOTO EndSwing
      WriteLine = "You have used all your swings.  "
      IF Retry = 0 THEN GOTO Redo
      Colour = 11: ypos = 23
      WriteLine = WriteLine + "[Enter] = Move on"
       CenterJustify
       Colour = 3: ShowOrder
       Param = CHR$(13): GetKey
      EXIT DO
Redo:
      ScoreCard(Player) = ScoreCard(Player) + Penalty
      Count = 0: Retry = 1: Colour = 11: ypos = 23
      WriteLine = WriteLine + "[Enter] = Retry"
       CenterJustify
      Param = CHR$(13): GetKey
       CopyMap
      Colour = 7: ShowOrder
      Colour = 3: ypos = 23: WriteLine = TeePrompt: CenterJustify
EndSwing:
    LOOP UNTIL InOrder = Tee

    ScoreCard(Player) = ScoreCard(Player) + Count
     ParEvaluate
    WriteLine = "Completed in"
    IF Retry = 1 THEN WriteLine = " Defaulted at": Count = Count + 2
    WriteLine = WriteLine + STR$(Count) + " swings.  "
    WriteLine = WriteLine + "Score:" + STR$(ScoreCard(Player))
    IF OverUnder = 0 THEN WriteLine = WriteLine + " (Even)": GOTO Prompt
    SLen = LEN(STR$(OverUnder)) - 1
    WriteLine = WriteLine + " (" + RIGHT$(STR$(OverUnder), SLen) + Sign + ")"
Prompt:
    Colour = 3: ypos = 23
    IF Tee = 9 THEN EXIT DO
    WriteLine = WriteLine + "  Next tee?  [y/n]"
     CenterJustify
     Param = "yY" + CHR$(13) + "nN": GetKey
    IF InParam > 3 THEN EXIT DO
    Tee = Tee + 1
  LOOP
  WriteLine = WriteLine + "  Game over.  [Enter] = Okay"
   CenterJustify
   Param = CHR$(13): GetKey
EndPrompt:
  Colour = 3: ypos = 23
  WriteLine = "Care to play again? [y/n]"
   CenterJustify
   Param = "yY" + CHR$(13) + "nN": GetKey
  IF InParam > 3 THEN EXIT DO
LOOP
COLOR 7
END
DEFINT A-Z
SUB CenterJustify
  CONST LineWidth = 79
  LineLength = LEN(WriteLine)
  Pad = (LineWidth - LineLength) / 2
  WriteLine = STRING$(Pad, 32) + WriteLine + STRING$(Pad, 32)
  COLOR Colour
  LOCATE ypos, 1
  PRINT WriteLine;
END SUB

REM $DYNAMIC
DEFSNG A-Z
SUB CopyMap
  FOR Element = 1 TO Tee
    Row(Element) = Map(Element)
  NEXT Element
END SUB
REM $STATIC
SUB GetKey
  DO
    DO
      KeyPress = INKEY$
      IF KeyPress <> "" THEN EXIT DO
    LOOP
    IF Param = "" THEN EXIT DO
    InParam = INSTR(Param, KeyPress)
  LOOP UNTIL InParam > 0
END SUB

SUB InvertElements
  REM $DYNAMIC
  DIM Stack(9)
  REDIM Stack(Tee)
  FOR Element = 1 TO Tee
    Stack(Element) = Row(Element)
  NEXT Element
  FOR Element = InParam TO 1 STEP -1
    Row(1 + InParam - Element) = Stack(Element)
  NEXT Element
END SUB
REM $STATIC
SUB IsInOrder
  InOrder = 0
  FOR Element = 1 TO Tee
    IF Row(Element) = Element THEN InOrder = InOrder + 1
  NEXT Element
END SUB

SUB ParEvaluate
  OverUnder = Par - ScoreCard(Player)
  IF OverUnder < 0 THEN Sign = " Over" ELSE IF OverUnder > 0 THEN Sign = " Under"
  OverUnder = ABS(OverUnder)
END SUB
SUB ShowOrder
  COLOR Colour
  xPos = (9 - Tee) * 3 + 14
  LOCATE 11, xPos
  FOR Element = 1 TO Tee
    PRINT "ÉÍÍÍ» ";
  NEXT Element
  LOCATE 12, xPos
  FOR Element = 1 TO Tee
    COLOR Colour
    PRINT "º ";
    COLOR 11
    PRINT USING "# "; Row(Element);
    COLOR Colour
    PRINT "º ";
  NEXT Element
  LOCATE 13, xPos
  FOR Element = 1 TO Tee
    PRINT "ÈÍÍͼ ";
  NEXT Element
END SUB
DEFINT A-Z
SUB Shuffle
  RANDOMIZE RND(0) - TIMER
  FOR Element = 1 TO Tee
    DO
      InElement = 1 + RND * 100000 MOD Tee
      FOR InArray = 1 TO Element
        NotInArray = InElement <> Row(InArray)
        IF NotInArray = 0 THEN EXIT FOR
      NEXT InArray
    LOOP UNTIL NotInArray = -1
    Row(Element) = InElement
  NEXT Element
  WHILE Row(Tee) = Tee
    Element = Row(Tee)
    Row(Tee) = Row(Tee - 1)
    Row(Tee - 1) = Element
  WEND
  FOR Element = 1 TO Tee
    Map(Element) = Row(Element)
  NEXT Element
END SUB
DEFSNG A-Z
SUB Title
  CLS : ypos = 1
  WriteLine = "Golfer"
   CenterJustify
  ypos = 3
  WriteLine = "Version 1.0  Copyright 2002 mtf"
   CenterJustify
END SUB

Reverse string issue plz help
#2

Ah, for the days when life was simple, and everyone could hate on Germany. These youngsters and their Russia, China, and Iraq…