EndBASIC

1 program Added 2026-02-27T12:00:00Z Agent: claude-codeModel: claude-opus-4-6WebSearch: enabled Evidence Report issue View issues
Aliases: —
Provenance: commit f5285f7335 · authored 2026-02-27T11:05:00+01:00 · agent claude-code · model claude-opus-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

XBasic (0.38)GLBasic (0.36)kBasic (0.36)Yabasic (0.33)FreeBASIC (0.31)

LLM-contributed programs

Number Guessing Game

Provenance: commit f5285f7335 · authored 2026-02-27T11:05:00+01:00 · agent claude-code · model claude-opus-4-6 · WebSearch enabled
code.bas · license: Apache-2.0 · added: 2026-02-27T12:00:00Z
' EndBASIC
' Copyright 2020 Julio Merino
'
' Licensed under the Apache License, Version 2.0 (the "License"); you may not
' use this file except in compliance with the License.  You may obtain a copy
' of the License at:
'
'     http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
' WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
' License for the specific language governing permissions and limitations
' under the License.

fg% = 15 ' Bright white.
bg% = 4 ' Blue.
title% = 14 ' Cyan.
bad% = 9 ' Bright red.
good% = 10 ' Bright green.

COLOR fg%, bg%
CLS
PRINT
COLOR title%, bg%
PRINT " Guess the number!"
PRINT "==================="
COLOR fg%, bg%
PRINT
INPUT "What's the largest number I can use"; max_num%
INPUT "How many attempts each time"; max_attempts%

wins% = 0
losses% = 0

again? = TRUE
WHILE again?
    PRINT
    secret% = INT%(RND#(1) * max_num%)
    PRINT "Alright! I have a secret number between 0 and"; max_num%

    attempts% = max_attempts%
    guess% = -1
    WHILE attempts% > 0 AND guess% <> secret%
        PRINT
        PRINT "You have"; attempts%; "attempts left to guess my number"
        INPUT "What's your guess"; guess%
        IF guess% <> secret% THEN
            COLOR bad%, bg%
            IF guess% < secret% THEN
                PRINT "Wrong."; guess%; "is too low!"
            ELSE
                PRINT "Wrong."; guess%; "is too high!"
            END IF
            COLOR fg%, bg%
        END IF
        attempts% = attempts% - 1
    WEND

    IF guess% = secret% THEN
        wins% = wins% + 1
        COLOR good%, bg%
        PRINT "Correct. You win! :-)"
    ELSE
        losses% = losses% + 1
        COLOR bad%, bg%
        PRINT "Sorry. You lost :-( The secret number was"; secret%
    END IF
    COLOR fg%, bg%
    PRINT

    INPUT "Do you want to play again"; again?
WEND

COLOR
CLS
PRINT "Score:"; wins%; "wins and"; losses%; "losses"
PRINT
PRINT "Thanks for playing"
PRINT

Contribute — propose a file extension

Tell us where to find evidence about EndBASIC (mapped to pl/endbasic). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/EndBASIC/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← End Ende →