1. QBasic to Euphoria
- Posted by Steve Elder <SteveElde at AOL.COM> Feb 16, 1997
- 1125 views
Hi everybody, I'm new to Euphoria, and this mailing list. I have this QBasic program I would like to translate to Euphoria. Any ideas? 'Computes points earned by hockey teams. CLS INPUT " TEAM: ", team$ 'Enter team name. INPUT " WON : ", won 'Number of games won. INPUT " LOST: ", lost 'Number of games lost. INPUT " TIE : ", tie 'Number of ties. points = won * 2 + tie 'Compute number of points. PRINT "TEAM", " WON", " LOST", " TIE", " POINTS" 'Display results. PRINT team$, won, lost, tie, points 'Display results. Thanks in advance, Steve Elder
2. Re: QBasic to Euphoria
- Posted by "Lucius L. Hilley III" <luciuslhilleyiii at JUNO.COM> Feb 16, 1997
- 1112 views
include get.e --this is used for value() command integer won, lost, tie, points -- setup integers sequence team, buffer -- setup sequence !similar to strings! clear_screen() puts(1, " TEAM: ")--PRINT "TEAM: "; buffer = gets(0)-- get a sequence !similar to a string! team = buffer[1..length(buffer) - 1]-- put buffer into team without the linefeed puts(1, "\n WON: ")--PRINT "WON: "; buffer = {1}-- set this so loop will start while buffer[1] = 1 do--loops until valid value for won buffer = gets(0) buffer = value(buffer) if buffer[1] != 1 then won = buffer[2]--puts valid value into won else puts(1, "\n WON: ") end if end while puts(1, "\n LOST: ") buffer = {1} while buffer[1] = 1 do--loops until valid value for lost buffer = gets(0) buffer = value(buffer) if buffer[1] != 1 then lost = buffer[2]--puts valid value into lost else puts(1, "\n LOST: ") end if end while puts(1, "\n TIES: ") buffer = {1} while buffer[1] = 1 do--loops until valid value for lost buffer = gets(0) buffer = value(buffer) if buffer[1] != 1 then tie = buffer[2]--puts valid value into tie else puts(1, "\n TIES: ") end if end while points = won * 2 + tie --Compute number of points. puts(1, "\nTEAM\tWON\tLOST\tTIE\tPOINTS") --Display results. printf(1, "\n%s\t%d\t%d\t%d\t%d", {team, won, lost, tie, points}) --that should do it Lucius L. Hilley III