September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -1,8 +1,2 @@
10 PRINT "ENTER A STRING"
20 INPUT S$
30 PRINT "YOU ENTERED: ";S$
40 PRINT "NOW ENTER THE NUMBER 75000"
50 INPUT N
60 IF N=75000 THEN STOP
70 PRINT "NO, ";
80 GOTO 40
100 INPUT PROMPT "Enter a number: ":NUM
110 INPUT PROMPT "Enter a string: ":ST$

View file

@ -0,0 +1,8 @@
10 PRINT "ENTER A STRING"
20 INPUT S$
30 PRINT "YOU ENTERED: ";S$
40 PRINT "NOW ENTER THE NUMBER 75000"
50 INPUT N
60 IF N=75000 THEN STOP
70 PRINT "NO, ";
80 GOTO 40

View file

@ -1,9 +1,9 @@
import extensions.
import extensions;
program =
[
var num := Integer new.
console write:"Enter an integer: "; readLine:num.
public program()
{
var num := new Integer();
console.write:"Enter an integer: ".loadLineTo:num;
var word := console write:"Enter a String: "; readLine.
].
var word := console.write:"Enter a String: ".readLine()
}

View file

@ -0,0 +1,35 @@
/**
User input/Text, in Neko
Tectonics:
nekoc userinput.neko
neko userinput
*/
var stdin = $loader.loadprim("std@file_stdin", 0)()
var file_read_char = $loader.loadprim("std@file_read_char", 1)
/* Read a line from file f into string s returning length without any newline */
var NEWLINE = 10
var readline = function(f, s) {
var len = 0
var ch
while true {
try ch = file_read_char(f) catch a break;
if ch == NEWLINE break;
if $sset(s, len, ch) == null break; else len += 1
}
return $ssub(s, 0, len)
}
$print("Enter a line of text, then the number 75000\n")
try {
var RECL = 132
var str = $smake(RECL)
var userstring = readline(stdin, str)
$print(":", userstring, ":\n")
var num = $int(readline(stdin, str))
if num == 75000 $print("Rosetta Code 75000, for the win!\n")
else $print("Sorry, need 75000\n")
} catch problem $print("Exception: ", problem, "\n")

View file

@ -1,4 +1,4 @@
#!/usr/bin/perl
my $string = <>; # equivalent to readline(*STDIN)
print "Enter a string: ";
my $string = <>;
print "Enter an integer: ";
my $integer = <>;

View file

@ -0,0 +1,8 @@
input string "Enter string:"
set "$str" to "input"
input string "Enter number:"
set "number" to "input"
[ "You entered:"
[ "&$str&"
[ "&number&"
end

View file

@ -0,0 +1,10 @@
input string "Enter string:"
set "$str" to "input"
: "incorrect"
input string "Enter number:"
set "number" to "input"
if "number" != "(75000)" then "incorrect"
[ "You entered:"
[ "&$str&"
[ "&number&"
end

View file

@ -0,0 +1,4 @@
Public Sub text()
Debug.Print InputBox("Input a string")
Debug.Print InputBox("Input the integer 75000", "Input an integer", 75000, Context = "Long")
End Sub