Oh teh noes, you have to use "to" instead of a comma and "endfor" instead of "end". I'll assume there's more to it than that, but your example code doesn't exactly look "painful".
Mainly in that example code I was pointing out you can only define one item at a time and as reference for even more annoyance to that one at a time issue if you don't initialize all used variables quickly enough on start the program will error out.
Most painful language… so first question is serious or esoteric?
I was mainly referring to serious languages although esoteric ones can be included too :P/>/>
also for anyone who is curious to see the final outcome of this frustrating language heres how my final ended up looking
Spoiler
PROGRAM tictac
VAR
notbox : INTEGER
ltpli : INTEGER
ltpls : INTEGER
ballline : PATH
index1 : INTEGER
index2 : INTEGER
index3 : INTEGER
plays : INTEGER
waslog : INTEGER
perch : JOINTPOS
boxset : ARRAY [9, 3] OF JOINTPOS
boxplay : ARRAY[9] OF INTEGER
winpnt : ARRAY [8, 3] OF INTEGER
fingame : ARRAY[2] OF INTEGER
tactic : ARRAY[9] OF INTEGER
ROUTINE jntswap
BEGIN
IF $SPEED < 750 THEN
$MOTYPE = JOINT
$SPEED = 750
ELSE
$MOTYPE = LINEAR
$SPEED = 200
ENDIF
END jntswap
ROUTINE getball
BEGIN
MOVE TO ballline[1]
jntswap
MOVE TO ballline[2] NOWAIT
DOUT[3] = TRUE
DELAY 1000
MOVE TO ballline[1] NOWAIT
MOVE TO ballline[3]
DELAY 400
jntswap
MOVE TO perch NOWAIT
END getball
ROUTINE place
BEGIN
plays = plays + 1
boxplay[ltpli] = ltpls
MOVE TO (boxset[ltpli, 1])
jntswap
MOVE TO boxset[ltpli, 2] NOWAIT
MOVE TO boxset[ltpli, 3]
DOUT[3] = FALSE
DELAY 1000
MOVE TO boxset[ltpli, 2] NOWAIT
MOVE TO boxset[ltpli, 1]
jntswap
MOVE TO perch NOWAIT
getball
END place
ROUTINE plmove
BEGIN
pl1::
FOR index1 = 1 TO 9 DO
IF (DIN[index1] = TRUE) AND (boxplay[index1] = 0) THEN
ltpls = 1
ltpli = index1
place
RETURN
ELSE
IF DIN[index1] = TRUE THEN
DOUT[4] = TRUE
DELAY 300
DOUT[4] = FALSE
ENDIF
ENDIF
ENDFOR
GOTO pl1
END plmove
ROUTINE wingame
BEGIN
IF fingame[1] <> 0 THEN
MOVE TO boxset[fingame[index1], 1]
jntswap
MOVE TO boxset[fingame[index1], 1]
jntswap
FOR index1 = 1 TO 5 DO
DOUT[6] = TRUE
DELAY 250
DOUT[6] = FALSE
ENDFOR
ELSE
MOVE TO boxset[9, 1]
jntswap
MOVE TO boxset[7, 1] NOWAIT
MOVE TO boxset[1, 1] NOWAIT
MOVE TO boxset[3, 1] NOWAIT
FOR index1 = 1 TO 5 DO
DOUT[5] = TRUE
DELAY 250
DOUT[5] = FALSE
ENDFOR
ENDIF
jntswap
MOVE TO perch
ABORT
END wingame
ROUTINE logic
BEGIN
FOR index1 = 1 TO 8 DO
index3 = 0
FOR index2 = 1 TO 3 DO
IF boxplay[winpnt[index1, index2]] = 2 THEN
index3 = index3 + 1
ELSE
notbox = boxplay[winpnt[index1, index2]]
ENDIF
ENDFOR
IF index3 = 2 THEN
ltpls = 2
ltpli = notbox
place
fingame[1] = winpnt[index1, 1]
fingame[2] = winpnt[index1, 3]
wingame
ENDIF
ENDFOR
END logic
BEGIN
notbox = 0
ltpls = 0
index1 = 0
index2 = 0
index3 = 0
plays = 0
waslog = 1
ltpli = 1
FOR index1 = 1 TO 9 DO
boxplay[index1] = 0
tactic[index1] = 0
ENDFOR
fingame[1] = 0
fingame[2] = 0
FOR index1 = 1 TO 8 DO
FOR index2 = 1 TO 3 DO
winpnt[index1, index2] = 0
ENDFOR
ENDFOR
FOR index1 = 4 TO 6 DO
DOUT[index1] = FALSE
ENDFOR
FOR index1 = 1 TO 9 DO
boxplay[index1] = 0
ENDFOR
tactic[5] = 5
FOR index1 = 1 TO 3 DO
tactic[index1] = 5 - index1
tactic[index1+6] = 9 - index1
ENDFOR
FOR index1 = 1 TO 8 DO
FOR index2 = 1 TO 3 DO
winpnt[index1, index2] = (9 - index1) - ((index2 - 1) * 3)
winpnt[index1 + 3, index2] = (((index1 + 3) - 4) * 3) + index2
ENDFOR
winpnt[7, index1] = 1 + (index1 * 2)
winpnt[8, index1] = 1 + ((index1 - 1) * 4)
ENDFOR
tactic[4] = 1
tactic[6] = 9
$TERMTYPE = NODECEL
$SPEED = 750
MOVE TO perch NOWAIT
getball
ltpli = 5
ltpls = 2
place
l1::
plmove
logic
ltpli = tactic[ltpli]
ltpls = 2
IF plays = 9 THEN
fingame[1] = 0
fingame[2] = 0
wingame
ENDIF
GOTO l1
END tictac
list of annoyances in this code
*(most) whitespace is required and cant be changed such as including a space or not OR using tab instead of several spaces.
*the inconsistent need that some items ALWAYS be lowercase while others ALWAYS be uppercase
*numbers cant go past 255
*any defined names including the name of the program cant have more than 8 characters
*the size of an array has to be predefined and cant be changed after. You can use a wild card size "[*]" however the max size still needs to be defined at the start of the program so its rather pointless in my opinion…
*if you use any string variables you need to define the length of the string similar to how you define the length of an array
*array indexes can only be defined one at a time
*arrays can only be a max of three dimensional (though this didn't end up being an issue for me)
and the one I found most annoying of any of the other issues with this class
in lua (and most languages that i know of) this is accepted
a = function()
b()
end
b = function()
number = 1
end
a()
however in karel if we attempt something similar…
PROGRAM foo
VAR
number :INTEGER
ROUTINE a
BEGIN
b --#Will error here because b wasn't defined yet even though technically we don't call out b until after it is defined
END a
ROUTINE b
BEGIN
number = 1
END b
BEGIN
a
END foo
This made it really tedious trying to organize my code so nothing referenced another routine before the routine was defined in the code.