diff --git a/buildapp.xml b/buildapp.xml index 55cb26a3..28b1c4fd 100644 --- a/buildapp.xml +++ b/buildapp.xml @@ -15,8 +15,8 @@ name="Structorizer" displayname="Structorizer" identifier="lu.fisch.Structorizer" - shortversion="3.32-02" - version="3.32-02" + shortversion="3.32-04" + version="3.32-04" icon="icons/Structorizer.icns" mainclassname="Structorizer" copyright="Bob Fisch" diff --git a/samples/export/ARM_gnu/ELIZA_2.3.txt b/samples/export/ARM_gnu/ELIZA_2.3.txt new file mode 100644 index 00000000..b0c70c40 --- /dev/null +++ b/samples/export/ARM_gnu/ELIZA_2.3.txt @@ -0,0 +1,581 @@ +// Generated with Structorizer 3.32-04 on Tue Nov 02 16:07:47 CET 2021 +.global _start +.data +.align 2 +v_15: .word '.',',',';','!','?' +.align 2 +result: .word -1,0 +.align 2 +v_14: .word " i "," i\'" +.align 2 +v_13: .word 'P','l','e','a','s','e',' ','d','o','n',0x27,'t',' ','r','e','p','e','a','t',' ','y','o','u','r','s','e','l','f','!' +.align 2 +v_12: .word 'H','i','!',' ','I',0x27,'m',' ','y','o','u','r',' ','n','e','w',' ','t','h','e','r','a','p','i','s','t','.',' ','M','y',' ','n','a','m','e',' ','i','s',' ','E','l','i','z','a','.',' ','W','h','a','t',0x27,'s',' ','y','o','u','r',' ','p','r','o','b','l','e','m','?' +.align 2 +v_11: .word '*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*' +.align 2 +v_10: .word '*',' ','(','R','e','q','u','i','r','e','s',' ','a','t',' ','l','e','a','s','t',' ','S','t','r','u','c','t','o','r','i','z','e','r',' ','3','.','3','0','-','0','3',' ','t','o',' ','r','u','n',')' +.align 2 +v_9: .word '*',' ','V','e','r','s','i','o','n',':',' ','2','.','3',' ','(','2','0','2','0','-','0','2','-','2','4',')' +.align 2 +v_8: .word '*',' ','-',' ','K','a','y',' ','G',0xfc,'r','t','z','i','g',' ','/',' ','F','H',' ','E','r','f','u','r','t',' ','2','0','1','6' +.align 2 +v_7: .word '*',' ','A','d','a','p','t','e','d',' ','f','o','r',' ','S','t','r','u','c','t','o','r','i','z','e','r',' ','b','y' +.align 2 +v_6: .word '*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*' +.align 2 +v_5: .word '*',' ','-',' ','P','a','u','l',' ','H','a','s','h','f','i','e','l','d' +.align 2 +v_4: .word '*',' ','-',' ','P','a','t','r','i','c','i','a',' ','D','a','n','i','e','l','s','o','n' +.align 2 +v_3: .word '*',' ','A','d','a','p','t','e','d',' ','f','o','r',' ','B','a','s','i','c',' ','o','n',' ','I','B','M',' ','P','C',' ','b','y' +.align 2 +v_2: .word '*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*' +.align 2 +v_1: .word '*',' ','O','r','i','g','i','n','a','l',' ','d','e','s','i','g','n',' ','b','y',' ','J','.',' ','W','e','i','z','e','n','b','a','u','m' +.align 2 +v_0: .word '*','*','*','*','*','*','*','*','*','*','*','*','*',' ','E','L','I','Z','A',' ','*','*','*','*','*','*','*','*','*','*','*','*','*','*' +.text +.align 2 +_start: + // Title information + LDR R2, =0xFF201000 + ADR R3, v_0 + STR R3, [R2] + LDR R2, =0xFF201000 + ADR R3, v_1 + STR R3, [R2] + LDR R2, =0xFF201000 + ADR R3, v_2 + STR R3, [R2] + LDR R2, =0xFF201000 + ADR R3, v_3 + STR R3, [R2] + LDR R2, =0xFF201000 + ADR R3, v_4 + STR R3, [R2] + LDR R2, =0xFF201000 + ADR R3, v_5 + STR R3, [R2] + LDR R2, =0xFF201000 + ADR R3, v_6 + STR R3, [R2] + LDR R2, =0xFF201000 + ADR R3, v_7 + STR R3, [R2] + LDR R2, =0xFF201000 + ADR R3, v_8 + STR R3, [R2] + LDR R2, =0xFF201000 + ADR R3, v_9 + STR R3, [R2] + LDR R2, =0xFF201000 + ADR R3, v_10 + STR R3, [R2] + LDR R2, =0xFF201000 + ADR R3, v_11 + STR R3, [R2] + // Stores the last five inputs of the user in a ring buffer, + // the second component is the rolling (over-)write index. + // ERROR: Not implemented yet + // history <- History{{"", "", "", "", ""}, 0} + STMFD SP!, {LR} + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL setupReplies + // Subroutine result: + LDR R2, [SP] + ADD SP, #4 + LDMFD SP!, {LR} + STMFD SP!, {LR} + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL setupReflexions + // Subroutine result: + LDR R3, [SP] + ADD SP, #4 + LDMFD SP!, {LR} + STMFD SP!, {LR} + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL setupGoodByePhrases + // Subroutine result: + LDR R4, [SP] + ADD SP, #4 + LDMFD SP!, {LR} + STMFD SP!, {LR} + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL setupKeywords + // Subroutine result: + LDR R5, [SP] + ADD SP, #4 + LDMFD SP!, {LR} + // ERROR: Not implemented yet + // offsets[length(keyMap)-1] <- 0 + MOV R6, #0 + // Starter + LDR R7, =0xFF201000 + ADR R8, v_12 + STR R8, [R7] +do_0: + LDR R7, =0xFF200050 + LDR R7, [R7] + // Converts the input to lowercase, cuts out interpunctation + // and pads the string + STMFD SP!, {LR} + STR R7, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL normalizeInput + // Subroutine result: + LDR R7, [SP] + ADD SP, #8 + LDMFD SP!, {LR} + STMFD SP!, {LR} + STR R7, [SP,#-4]! + STR R4, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL checkGoodBye + // Subroutine result: + LDR R6, [SP] + ADD SP, #12 + LDMFD SP!, {LR} + CMP R6, #0 + BNE end_1 +then_1: + ADR R8, v_13 + STMFD SP!, {LR} + STR R9, [SP,#-4]! + STR R7, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL checkRepetition + // Subroutine result: + LDR R10, [SP] + ADD SP, #12 + LDMFD SP!, {LR} + CMP R10, #0 + BNE end_2 +then_2: + STMFD SP!, {LR} + STR R5, [SP,#-4]! + STR R7, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL findKeyword + // Subroutine result: + LDR R12, [SP] + ADD SP, #12 + LDMFD SP!, {LR} + // The array is not initialized + CMP R11, #0 + BGE end_3 +then_3: + // Should never happen... + // ERROR: Not implemented yet + // keyIndex <- length(keyMap)-1 +end_3: + // ERROR: Not implemented yet + // var entry: KeyMapEntry <- keyMap[keyIndex] + // Variable part of the reply + // ERROR: Not implemented yet + // varPart <- "" + // ERROR: Unsupported condition syntax - Alternative skipped! + // if (length(entry.keyword)>0) + // ERROR: Not implemented yet + // replyRing <- replies[entry.index] + // ERROR: Not implemented yet + // reply <- replyRing[offsets[keyIndex]] + // ERROR: Not implemented yet + // offsets[keyIndex] <- (offsets[keyIndex] + 1) mod length(replyRing) + // ERROR: Not implemented yet + // posAster <- pos("*", reply) + CMP R0, #0 + BLE end_4 +then_4: + // ERROR: Unsupported condition syntax - Alternative skipped! + // if (varPart==" ") +end_4: + STMFD SP!, {LR} + STR R8, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL adjustSpelling + // Subroutine result: + LDR R8, [SP] + ADD SP, #8 + LDMFD SP!, {LR} +end_2: + LDR R1, =0xFF201000 + STR R8, [R1] +end_1: + CMP R6, #0 + BEQ do_0 + + // Endless loop generated at the end of program +stopELIZA: + B stopELIZA +adjustSpelling: + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + MOV R3, R2 + MOV R4, #1 + // ERROR: Unsupported condition syntax - While skipped! + // while (position<=length(sentence))&&(copy(sentence,position,1)==" ") + // ERROR: Unsupported condition syntax - Alternative skipped! + // if (position<=length(sentence)) + ADR R6, v_14 + MOV R7, #0 +for_5: + CMP R7, #1 + BGT end_5 + LDR R5, [R6, R7, LSL #2] + // ERROR: Not implemented yet + // position <- pos(word, result) +while_6: + CMP R4, #0 + BLE end_6 + // ERROR: Not implemented yet + // delete(result, position+1, 1) + // ERROR: Not implemented yet + // insert("I", result, position+1) + // ERROR: Not implemented yet + // position <- pos(word, result) + B while_6 +end_6: + ADD R7, R7, #1 + B for_5 +end_5: + STR R3, [SP,#13,#2] + LDMFD SP!, {R0-R12} + MOVS PC, LR + +checkGoodBye: + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + MOV R5, #0 +for_7: + // WARNING: End value expression too complex + CMP R5, + BGT end_7 + // The array is not initialized + // ERROR: Unsupported condition syntax - Alternative skipped! + // if (pos(pair[0],text)>0) + ADD R5, R5, #1 + B for_7 +end_7: + // ERROR: Not implemented yet + // return false + +checkRepetition: + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + MOV R4, #0 + // ERROR: Unsupported condition syntax - Alternative skipped! + // if (length(newInput)>4) + // ERROR: Not implemented yet + // return hasOccurred + +conjugateStrings: + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + LDR R4, [SP,#17,LSL #2] + LDR R5, [SP,#18,LSL #2] + // ERROR: Not implemented yet + // result <- " " + copy(sentence, keyPos + length(key), length(sentence)) + " " + MOV R7, #0 +for_8: + // WARNING: End value expression too complex + CMP R7, + BGT end_8 + // The array is not initialized + // ERROR: Not implemented yet + // left <- "" + MOV R8, R9 + // ERROR: Not implemented yet + // position <- pos(pair[0], right) +while_9: + CMP R10, #0 + BLE end_9 + // ERROR: Not implemented yet + // left <- left + copy(right, 1, position-1) + pair[1] + // ERROR: Not implemented yet + // right <- copy(right, position + length(pair[0]), length(right)) + // ERROR: Not implemented yet + // position <- pos(pair[0], right) + B while_9 +end_9: + ADD R9, R12, R8 + ADD R7, R7, #1 + B for_8 +end_8: + // Eliminate multiple spaces + // ERROR: Not implemented yet + // position <- pos(" ", result) +while_10: + CMP R10, #0 + BLE end_10 + // ERROR: Not implemented yet + // result <- copy(result, 1, position-1) + copy(result, position+1, length(result)) + // ERROR: Not implemented yet + // position <- pos(" ", result) + B while_10 +end_10: + STR R9, [SP,#13,#2] + LDMFD SP!, {R0-R12} + MOVS PC, LR + +findKeyword: + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + // Contains the index of the keyword and its position in sentence + MOV R4, #0 + // ERROR: Unsupported condition syntax - While skipped! + // while (result[0]<0)&&(ivalues[i+1]) + ADD R4, R4, #1 + B for_6 +end_6: + SUB R5, R3, #1 + CMP R3, #0 + BGE do_5 + LDMFD SP!, {R0-R12} + MOVS PC, LR + +maxHeapify: + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + LDR R4, [SP,#17,LSL #2] + // Indices of left and right child of node i + // ERROR: Not implemented yet + // right <- (i+1) * 2 + SUB R5, R6, #1 + // Index of the (local) maximum + MOV R7, R3 + // ERROR: Unsupported condition syntax - Alternative skipped! + // if (leftheap[i]) + // ERROR: Unsupported condition syntax - Alternative skipped! + // if (rightheap[max]) + CMP R7, R3 + BEQ end_7 +then_7: + // The array is not initialized + // ERROR: Not implemented yet + // heap[i] <- heap[max] + ADR R4, heap + STR R8, [R4, R7] + STMFD SP!, {LR} + STR R4, [SP,#-4]! + STR R7, [SP,#-4]! + STR R2, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL maxHeapify + ADD SP, #16 + LDMFD SP!, {LR} +end_7: + LDMFD SP!, {R0-R12} + MOVS PC, LR + +partition: + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + LDR R4, [SP,#17,LSL #2] + LDR R5, [SP,#18,LSL #2] + // Cache the pivot element + // The array is not initialized + // Exchange the pivot element with the start element + // ERROR: Not implemented yet + // values[p] <- values[start] + ADR R5, values + STR R6, [R5, R4] + MOV R2, R4 + // Beginning and end of the remaining undiscovered range + ADD R4, R4, #1 + SUB R3, R3, #1 + // Still unseen elements? + // Loop invariants: + // 1. p = start - 1 + // 2. pivot = values[p] + // 3. i < start → values[i] ≤ pivot + // 4. stop < i → pivot < values[i] +while_8: + CMP R4, R3 + BGT end_8 + // Fetch the first element of the undiscovered area + // The array is not initialized + // Does the checked element belong to the smaller area? + CMP R7, R6 + BGT else_9 +then_9: + // Insert the seen element between smaller area and pivot element + STR R7, [R5, R2] + STR R6, [R5, R4] + // Shift the border between lower and undicovered area, + // update pivot position. + ADD R2, R2, #1 + ADD R4, R4, #1 + B end_9 +else_9: + // Insert the checked element between undiscovered and larger area + // ERROR: Not implemented yet + // values[start] <- values[stop] + STR R7, [R5, R3] + // Shift the border between undiscovered and larger area + SUB R3, R3, #1 +end_9: + B while_8 +end_8: + // ERROR: Not implemented yet + // return p + +testSorted: + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + MOV R3, #1 + MOV R4, #0 + // As we compare with the following element, we must stop at the penultimate index + // ERROR: Unsupported condition syntax - While skipped! + // while (isSorted&&(i<=length(numbers)-2)) + // ERROR: Not implemented yet + // return isSorted + +buildMaxHeap: + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + // ERROR: Not implemented yet + // lgth <- length(heap) + // WARNING: Start value expression too complex + MOV R3, R4 R5 2 - 1 +for_10: + CMP R3, #0 + BLT end_10 + STMFD SP!, {LR} + STR R2, [SP,#-4]! + STR R3, [SP,#-4]! + STR R4, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL maxHeapify + ADD SP, #16 + LDMFD SP!, {LR} + SUB R3, R3, #1 + B for_10 +end_10: + LDMFD SP!, {R0-R12} + MOVS PC, LR + +quickSort: + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + LDR R4, [SP,#17,LSL #2] + // At least 2 elements? (Less don't make sense.) + // ERROR: Unsupported condition syntax - Alternative skipped! + // if (stop>=start+2) + LDMFD SP!, {R0-R12} + MOVS PC, LR + +heapSort: + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + STMFD SP!, {LR} + STR R2, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL buildMaxHeap + ADD SP, #8 + LDMFD SP!, {LR} + // ERROR: Not implemented yet + // heapRange <- length(values) + // WARNING: Start value expression too complex + MOV R3, R4 - 1 +for_11: + CMP R3, #1 + BLT end_11 + SUB R4, R4, #1 + // Swap the maximum value (root of the heap) to the heap end + // The array is not initialized + // ERROR: Not implemented yet + // values[0] <- values[heapRange] + ADR R2, values + STR R5, [R2, R4] + STMFD SP!, {LR} + STR R2, [SP,#-4]! + MOV R6, #0 + STR R6, [SP,#-4]! + STR R4, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL maxHeapify + ADD SP, #16 + LDMFD SP!, {LR} + SUB R3, R3, #1 + B for_11 +end_11: + LDMFD SP!, {R0-R12} + MOVS PC, LR diff --git a/samples/export/ARM_keil/ELIZA_2.3.txt b/samples/export/ARM_keil/ELIZA_2.3.txt new file mode 100644 index 00000000..473e530e --- /dev/null +++ b/samples/export/ARM_keil/ELIZA_2.3.txt @@ -0,0 +1,536 @@ +; Generated with Structorizer 3.32-04 on Tue Nov 02 16:08:50 CET 2021 +;AREA data, DATA, READWRITE +V_2 DCD '.',',',';','!','?' +result DCD -1,0 +V_1 DCD " i "," i\'" +V_0 DCD 'P','l','e','a','s','e',' ','d','o','n',0x27,'t',' ','r','e','p','e','a','t',' ','y','o','u','r','s','e','l','f','!' +;AREA text, CODE, READONLY + + ; Title information + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "************* ELIZA **************" + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "* Original design by J. Weizenbaum" + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "**********************************" + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "* Adapted for Basic on IBM PC by" + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "* - Patricia Danielson" + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "* - Paul Hashfield" + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "**********************************" + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "* Adapted for Structorizer by" + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "* - Kay Gürtzig / FH Erfurt 2016" + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "* Version: 2.3 (2020-02-24)" + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "* (Requires at least Structorizer 3.30-03 to run)" + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "**********************************" + ; Stores the last five inputs of the user in a ring buffer, + ; the second component is the rolling (over-)write index. + ; ERROR: Not implemented yet + ; history <- History{{"", "", "", "", ""}, 0} + STMFD SP!, {LR} + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL setupReplies + ; Subroutine result: + LDR R2, [SP] + ADD SP, #4 + LDMFD SP!, {LR} + STMFD SP!, {LR} + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL setupReflexions + ; Subroutine result: + LDR R3, [SP] + ADD SP, #4 + LDMFD SP!, {LR} + STMFD SP!, {LR} + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL setupGoodByePhrases + ; Subroutine result: + LDR R4, [SP] + ADD SP, #4 + LDMFD SP!, {LR} + STMFD SP!, {LR} + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL setupKeywords + ; Subroutine result: + LDR R5, [SP] + ADD SP, #4 + LDMFD SP!, {LR} + ; ERROR: Not implemented yet + ; offsets[length(keyMap)-1] <- 0 + MOV R6, #0 + ; Starter + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT "Hi! I\'m your new therapist. My name is Eliza. What\'s your problem?" +do_0 + ; ERROR: INPUT operation only supported with GNU code + ; INPUT userInput + ; Converts the input to lowercase, cuts out interpunctation + ; and pads the string + STMFD SP!, {LR} + STR R7, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL normalizeInput + ; Subroutine result: + LDR R7, [SP] + ADD SP, #8 + LDMFD SP!, {LR} + STMFD SP!, {LR} + STR R7, [SP,#-4]! + STR R4, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL checkGoodBye + ; Subroutine result: + LDR R6, [SP] + ADD SP, #12 + LDMFD SP!, {LR} + CMP R6, #0 + BNE end_1 +then_1 + LDR R8, =V_0 + STMFD SP!, {LR} + STR R9, [SP,#-4]! + STR R7, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL checkRepetition + ; Subroutine result: + LDR R10, [SP] + ADD SP, #12 + LDMFD SP!, {LR} + CMP R10, #0 + BNE end_2 +then_2 + STMFD SP!, {LR} + STR R5, [SP,#-4]! + STR R7, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL findKeyword + ; Subroutine result: + LDR R12, [SP] + ADD SP, #12 + LDMFD SP!, {LR} + ; The array is not initialized + CMP R11, #0 + BGE end_3 +then_3 + ; Should never happen... + ; ERROR: Not implemented yet + ; keyIndex <- length(keyMap)-1 +end_3 + ; ERROR: Not implemented yet + ; var entry: KeyMapEntry <- keyMap[keyIndex] + ; Variable part of the reply + ; ERROR: Not implemented yet + ; varPart <- "" + ; ERROR: Unsupported condition syntax - Alternative skipped! + ; if (length(entry.keyword)>0) + ; ERROR: Not implemented yet + ; replyRing <- replies[entry.index] + ; ERROR: Not implemented yet + ; reply <- replyRing[offsets[keyIndex]] + ; ERROR: Not implemented yet + ; offsets[keyIndex] <- (offsets[keyIndex] + 1) mod length(replyRing) + ; ERROR: Not implemented yet + ; posAster <- pos("*", reply) + CMP R0, #0 + BLE end_4 +then_4 + ; ERROR: Unsupported condition syntax - Alternative skipped! + ; if (varPart==" ") +end_4 + STMFD SP!, {LR} + STR R8, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL adjustSpelling + ; Subroutine result: + LDR R8, [SP] + ADD SP, #8 + LDMFD SP!, {LR} +end_2 + ; ERROR: OUTPUT operation only supported with GNU code + ; OUTPUT reply +end_1 + CMP R6, #0 + BEQ do_0 + + ; Endless loop generated at the end of program +stopELIZA + B stopELIZA +adjustSpelling + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + MOV R3, R2 + MOV R4, #1 + ; ERROR: Unsupported condition syntax - While skipped! + ; while (position<=length(sentence))&&(copy(sentence,position,1)==" ") + ; ERROR: Unsupported condition syntax - Alternative skipped! + ; if (position<=length(sentence)) + LDR R6, =V_1 + MOV R7, #0 +for_5 + CMP R7, #1 + BGT end_5 + LDR R5, [R6, R7, LSL #2] + ; ERROR: Not implemented yet + ; position <- pos(word, result) +while_6 + CMP R4, #0 + BLE end_6 + ; ERROR: Not implemented yet + ; delete(result, position+1, 1) + ; ERROR: Not implemented yet + ; insert("I", result, position+1) + ; ERROR: Not implemented yet + ; position <- pos(word, result) + B while_6 +end_6 + ADD R7, R7, #1 + B for_5 +end_5 + STR R3, [SP,#13,#2] + LDMFD SP!, {R0-R12} + MOVS PC, LR + +checkGoodBye + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + MOV R5, #0 +for_7 + ; WARNING: End value expression too complex + CMP R5, + BGT end_7 + ; The array is not initialized + ; ERROR: Unsupported condition syntax - Alternative skipped! + ; if (pos(pair[0],text)>0) + ADD R5, R5, #1 + B for_7 +end_7 + ; ERROR: Not implemented yet + ; return false + +checkRepetition + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + MOV R4, #0 + ; ERROR: Unsupported condition syntax - Alternative skipped! + ; if (length(newInput)>4) + ; ERROR: Not implemented yet + ; return hasOccurred + +conjugateStrings + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + LDR R4, [SP,#17,LSL #2] + LDR R5, [SP,#18,LSL #2] + ; ERROR: Not implemented yet + ; result <- " " + copy(sentence, keyPos + length(key), length(sentence)) + " " + MOV R7, #0 +for_8 + ; WARNING: End value expression too complex + CMP R7, + BGT end_8 + ; The array is not initialized + ; ERROR: Not implemented yet + ; left <- "" + MOV R8, R9 + ; ERROR: Not implemented yet + ; position <- pos(pair[0], right) +while_9 + CMP R10, #0 + BLE end_9 + ; ERROR: Not implemented yet + ; left <- left + copy(right, 1, position-1) + pair[1] + ; ERROR: Not implemented yet + ; right <- copy(right, position + length(pair[0]), length(right)) + ; ERROR: Not implemented yet + ; position <- pos(pair[0], right) + B while_9 +end_9 + ADD R9, R12, R8 + ADD R7, R7, #1 + B for_8 +end_8 + ; Eliminate multiple spaces + ; ERROR: Not implemented yet + ; position <- pos(" ", result) +while_10 + CMP R10, #0 + BLE end_10 + ; ERROR: Not implemented yet + ; result <- copy(result, 1, position-1) + copy(result, position+1, length(result)) + ; ERROR: Not implemented yet + ; position <- pos(" ", result) + B while_10 +end_10 + STR R9, [SP,#13,#2] + LDMFD SP!, {R0-R12} + MOVS PC, LR + +findKeyword + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + ; Contains the index of the keyword and its position in sentence + MOV R4, #0 + ; ERROR: Unsupported condition syntax - While skipped! + ; while (result[0]<0)&&(ivalues[i+1]) + ADD R4, R4, #1 + B for_6 +end_6 + SUB R5, R3, #1 + CMP R3, #0 + BGE do_5 + LDMFD SP!, {R0-R12} + MOVS PC, LR + +maxHeapify + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + LDR R4, [SP,#17,LSL #2] + ; Indices of left and right child of node i + ; ERROR: Not implemented yet + ; right <- (i+1) * 2 + SUB R5, R6, #1 + ; Index of the (local) maximum + MOV R7, R3 + ; ERROR: Unsupported condition syntax - Alternative skipped! + ; if (leftheap[i]) + ; ERROR: Unsupported condition syntax - Alternative skipped! + ; if (rightheap[max]) + CMP R7, R3 + BEQ end_7 +then_7 + ; The array is not initialized + ; ERROR: Not implemented yet + ; heap[i] <- heap[max] + LDR R4, =heap + STR R8, [R4, R7] + STMFD SP!, {LR} + STR R4, [SP,#-4]! + STR R7, [SP,#-4]! + STR R2, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL maxHeapify + ADD SP, #16 + LDMFD SP!, {LR} +end_7 + LDMFD SP!, {R0-R12} + MOVS PC, LR + +partition + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + LDR R4, [SP,#17,LSL #2] + LDR R5, [SP,#18,LSL #2] + ; Cache the pivot element + ; The array is not initialized + ; Exchange the pivot element with the start element + ; ERROR: Not implemented yet + ; values[p] <- values[start] + LDR R5, =values + STR R6, [R5, R4] + MOV R2, R4 + ; Beginning and end of the remaining undiscovered range + ADD R4, R4, #1 + SUB R3, R3, #1 + ; Still unseen elements? + ; Loop invariants: + ; 1. p = start - 1 + ; 2. pivot = values[p] + ; 3. i < start → values[i] ≤ pivot + ; 4. stop < i → pivot < values[i] +while_8 + CMP R4, R3 + BGT end_8 + ; Fetch the first element of the undiscovered area + ; The array is not initialized + ; Does the checked element belong to the smaller area? + CMP R7, R6 + BGT else_9 +then_9 + ; Insert the seen element between smaller area and pivot element + STR R7, [R5, R2] + STR R6, [R5, R4] + ; Shift the border between lower and undicovered area, + ; update pivot position. + ADD R2, R2, #1 + ADD R4, R4, #1 + B end_9 +else_9 + ; Insert the checked element between undiscovered and larger area + ; ERROR: Not implemented yet + ; values[start] <- values[stop] + STR R7, [R5, R3] + ; Shift the border between undiscovered and larger area + SUB R3, R3, #1 +end_9 + B while_8 +end_8 + ; ERROR: Not implemented yet + ; return p + +testSorted + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + MOV R3, #1 + MOV R4, #0 + ; As we compare with the following element, we must stop at the penultimate index + ; ERROR: Unsupported condition syntax - While skipped! + ; while (isSorted&&(i<=length(numbers)-2)) + ; ERROR: Not implemented yet + ; return isSorted + +buildMaxHeap + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + ; ERROR: Not implemented yet + ; lgth <- length(heap) + ; WARNING: Start value expression too complex + MOV R3, R4 R5 2 - 1 +for_10 + CMP R3, #0 + BLT end_10 + STMFD SP!, {LR} + STR R2, [SP,#-4]! + STR R3, [SP,#-4]! + STR R4, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL maxHeapify + ADD SP, #16 + LDMFD SP!, {LR} + SUB R3, R3, #1 + B for_10 +end_10 + LDMFD SP!, {R0-R12} + MOVS PC, LR + +quickSort + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + LDR R3, [SP,#16,LSL #2] + LDR R4, [SP,#17,LSL #2] + ; At least 2 elements? (Less don't make sense.) + ; ERROR: Unsupported condition syntax - Alternative skipped! + ; if (stop>=start+2) + LDMFD SP!, {R0-R12} + MOVS PC, LR + +heapSort + STMFD SP!, {R0-R12} + LDR R2, [SP,#15,LSL #2] + STMFD SP!, {LR} + STR R2, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL buildMaxHeap + ADD SP, #8 + LDMFD SP!, {LR} + ; ERROR: Not implemented yet + ; heapRange <- length(values) + ; WARNING: Start value expression too complex + MOV R3, R4 - 1 +for_11 + CMP R3, #1 + BLT end_11 + SUB R4, R4, #1 + ; Swap the maximum value (root of the heap) to the heap end + ; The array is not initialized + ; ERROR: Not implemented yet + ; values[0] <- values[heapRange] + LDR R2, =values + STR R5, [R2, R4] + STMFD SP!, {LR} + STR R2, [SP,#-4]! + MOV R6, #0 + STR R6, [SP,#-4]! + STR R4, [SP,#-4]! + STR R0, [SP,#-1,LSL #2] + SUB SP, #4 + MOV R0, #0 + SWP R0, R0, [SP] + BL maxHeapify + ADD SP, #16 + LDMFD SP!, {LR} + SUB R3, R3, #1 + B for_11 +end_11 + LDMFD SP!, {R0-R12} + MOVS PC, LR diff --git a/samples/export/BASIC0/ELIZA_2.3.bas b/samples/export/BASIC0/ELIZA_2.3.bas index 2c9bc9ce..b369aba2 100644 --- a/samples/export/BASIC0/ELIZA_2.3.bas +++ b/samples/export/BASIC0/ELIZA_2.3.bas @@ -9,7 +9,7 @@ 90 REM 2019-03-15 key map joined from keyword array and index map 100 REM 2019-03-28 Keyword "bot" inserted (same reply ring as "computer") 110 REM 2019-11-28 New global type "History" (to ensure a homogenous array) -120 REM Generated by Structorizer 3.32-01 +120 REM Generated by Structorizer 3.32-04 130 140 REM Copyright (C) 2018-05-14 Kay Gürtzig 150 REM License: GPLv3-link @@ -101,8 +101,8 @@ 1010 delete(result, 1, position) 1020 insert(uppercase(start), result, 1) 1030 END IF -1040 DIM arraydbdbf287() AS String = {" i ", " i\'"} -1050 FOR EACH word IN arraydbdbf287 +1040 DIM arraya8345b26() AS String = {" i ", " i\'"} +1050 FOR EACH word IN arraya8345b26 1060 LET position = pos(word, result) 1070 DO WHILE position > 0 1080 delete(result, position+1, 1) @@ -207,8 +207,8 @@ 2070 REM TODO: add the respective type suffixes to your variable names if required 2080 LET sentence = lowercase(sentence) 2090 REM TODO: Specify an appropriate element type for the array! -2100 DIM arraybd738552() AS FIXME_bd738552 = {'.', ',', ';', '!', '?'} -2110 FOR EACH symbol IN arraybd738552 +2100 DIM arrayeb858363() AS FIXME_eb858363 = {'.', ',', ';', '!', '?'} +2110 FOR EACH symbol IN arrayeb858363 2120 LET position = pos(symbol, sentence) 2130 DO WHILE position > 0 2140 LET sentence = copy(sentence, 1, position-1) + copy(sentence, position+1, length(sentence)) diff --git a/samples/export/BASIC0/SORTING_TEST_MAIN.bas b/samples/export/BASIC0/SORTING_TEST_MAIN.bas index 743af4cb..0680a5fa 100644 --- a/samples/export/BASIC0/SORTING_TEST_MAIN.bas +++ b/samples/export/BASIC0/SORTING_TEST_MAIN.bas @@ -2,7 +2,7 @@ 20 REM to allow performance comparison via execution counting ("Collect Runtime Data" should 30 REM sensibly be switched on). 40 REM Requested input data are: Number of elements (size) and filing mode. -50 REM Generated by Structorizer 3.32-01 +50 REM Generated by Structorizer 3.32-04 60 70 REM Copyright (C) 2019-10-02 Kay Gürtzig 80 REM License: GPLv3-link diff --git a/samples/export/BASIC1/ELIZA_2.3.bas b/samples/export/BASIC1/ELIZA_2.3.bas index b1cf111c..8e531662 100644 --- a/samples/export/BASIC1/ELIZA_2.3.bas +++ b/samples/export/BASIC1/ELIZA_2.3.bas @@ -9,7 +9,7 @@ Rem 2019-03-14 Replies and mapping reorganised for easier maintenance Rem 2019-03-15 key map joined from keyword array and index map Rem 2019-03-28 Keyword "bot" inserted (same reply ring as "computer") Rem 2019-11-28 New global type "History" (to ensure a homogenous array) -Rem Generated by Structorizer 3.32-01 +Rem Generated by Structorizer 3.32-04 Rem Copyright (C) 2018-05-14 Kay Gürtzig Rem License: GPLv3-link @@ -102,3 +102,324 @@ Do End If Loop Until isGone End +Rem +Rem Cares for correct letter case among others +Rem TODO: Check (and specify if needed) the argument and result types! +Function adjustSpelling(sentence As String) As String + Rem TODO: Check and accomplish your variable declarations here: + Dim word As String + Dim start As String + Dim result As String + Dim position As Integer + Rem + result = sentence + position = 1 + Do While (position <= length(sentence)) AND (copy(sentence, position, 1) = " ") + position = position + 1 + Loop + If position <= length(sentence) Then + start = copy(sentence, 1, position) + delete(result, 1, position) + insert(uppercase(start), result, 1) + End If + Dim arraya8345b26() As String = {" i ", " i\'"} + For Each word In arraya8345b26 + position = pos(word, result) + Do While position > 0 + delete(result, position+1, 1) + insert("I", result, position+1) + position = pos(word, result) + Loop + Next word + Return result +End Function +Rem +Rem Checks whether the given text contains some kind of +Rem good-bye phrase inducing the end of the conversation +Rem and if so writes a correspding good-bye message and +Rem returns true, otherwise false +Rem TODO: Check (and specify if needed) the argument and result types! +Function checkGoodBye(text As String, phrases As String(50,0 To 1)) As boolean + Rem TODO: Check and accomplish your variable declarations here: + Dim pair() As String + Rem + For Each pair In phrases + If pos(pair(0), text) > 0 Then + PRINT pair(1) + Return true + End If + Next pair + return false +End Function +Rem +Rem Checks whether newInput has occurred among the recently cached +Rem input strings in the histArray component of history and updates the history. +Rem TODO: Check (and specify if needed) the argument and result types! +Function checkRepetition(history As History, newInput As String) As boolean + Rem TODO: Check and accomplish your variable declarations here: + Dim i As Integer + Dim histDepth As Integer + Dim hasOccurred As boolean + Rem + hasOccurred = false + If length(newInput) > 4 Then + histDepth = length(history.histArray) + For i = 0 To histDepth-1 + If newInput = history.histArray(i) Then + hasOccurred = true + End If + Next i + history.histArray(history.histIndex) = newInput + history.histIndex = (history.histIndex + 1) % (histDepth) + End If + return hasOccurred +End Function +Rem +Rem TODO: Check (and specify if needed) the argument and result types! +Function conjugateStrings(sentence As String, key As String, keyPos As integer, flexions As String(50,0 To 1)) As String + Rem TODO: Check and accomplish your variable declarations here: + Dim right As String + Dim result As String + Dim position As Integer + Dim pair() As String + Dim left As String + Rem + result = " " + copy(sentence, keyPos + length(key), length(sentence)) + " " + For Each pair In flexions + left = "" + right = result + position = pos(pair(0), right) + Do While position > 0 + left = left + copy(right, 1, position-1) + pair(1) + right = copy(right, position + length(pair(0)), length(right)) + position = pos(pair(0), right) + Loop + result = left + right + Next pair + Rem Eliminate multiple spaces + position = pos(" ", result) + Do While position > 0 + result = copy(result, 1, position-1) + copy(result, position+1, length(result)) + position = pos(" ", result) + Loop + Return result +End Function +Rem +Rem Looks for the occurrence of the first of the strings +Rem contained in keywords within the given sentence (in +Rem array order). +Rem Returns an array of +Rem 0: the index of the first identified keyword (if any, otherwise -1), +Rem 1: the position inside sentence (0 if not found) +Rem TODO: Check (and specify if needed) the argument and result types! +Function findKeyword(Const keyMap As KeyMapEntry(50), sentence As String) As integer(0 To 1) + Rem TODO: Check and accomplish your variable declarations here: + Dim result() As Integer + Dim position As Integer + Dim i As Integer + Dim entry As KeyMapEntry + Rem + Rem Contains the index of the keyword and its position in sentence + Let result = Array(-1, 0) + i = 0 + Do While (result(0) < 0) AND (i < length(keyMap)) + var entry: KeyMapEntry = keyMap(i) + position = pos(entry.keyword, sentence) + If position > 0 Then + result(0) = i + result(1) = position + End If + i = i+1 + Loop + Return result +End Function +Rem +Rem Converts the sentence to lowercase, eliminates all +Rem interpunction (i.e. ',', '.', ';'), and pads the +Rem sentence among blanks +Rem TODO: Check (and specify if needed) the argument and result types! +Function normalizeInput(sentence As String) As String + Rem TODO: Check and accomplish your variable declarations here: + Dim symbol As char + Dim result As String + Dim position As Integer + Rem + sentence = lowercase(sentence) + Rem TODO: Specify an appropriate element type for the array! + Dim arrayeb858363() As FIXME_eb858363 = {'.', ',', ';', '!', '?'} + For Each symbol In arrayeb858363 + position = pos(symbol, sentence) + Do While position > 0 + sentence = copy(sentence, 1, position-1) + copy(sentence, position+1, length(sentence)) + position = pos(symbol, sentence) + Loop + Next symbol + result = " " + sentence + " " + Return result +End Function +Rem +Rem TODO: Check (and specify if needed) the argument and result types! +Function setupGoodByePhrases() As String(50,0 To 1) + Rem TODO: Check and accomplish your variable declarations here: + Dim phrases(,) As String + Rem + Let phrases(0) = Array(" shut", "Okay. If you feel that way I\'ll shut up. ... Your choice.") + Let phrases(1) = Array("bye", "Well, let\'s end our talk for now. See you later. Bye.") + return phrases +End Function +Rem +Rem The lower the index the higher the rank of the keyword (search is sequential). +Rem The index of the first keyword found in a user sentence maps to a respective +Rem reply ring as defined in `setupReplies()´. +Rem TODO: Check (and specify if needed) the argument and result types! +Function setupKeywords() As KeyMapEntry(50) + Rem TODO: Check and accomplish your variable declarations here: + Dim keywords() As KeyMapEntry + Rem + Rem The empty key string (last entry) is the default clause - will always be found + Let keywords(39).keyword = "" + Let keywords(39).index = 29 + Let keywords(0).keyword = "can you " + Let keywords(0).index = 0 + Let keywords(1).keyword = "can i " + Let keywords(1).index = 1 + Let keywords(2).keyword = "you are " + Let keywords(2).index = 2 + Let keywords(3).keyword = "you\'re " + Let keywords(3).index = 2 + Let keywords(4).keyword = "i don't " + Let keywords(4).index = 3 + Let keywords(5).keyword = "i feel " + Let keywords(5).index = 4 + Let keywords(6).keyword = "why don\'t you " + Let keywords(6).index = 5 + Let keywords(7).keyword = "why can\'t i " + Let keywords(7).index = 6 + Let keywords(8).keyword = "are you " + Let keywords(8).index = 7 + Let keywords(9).keyword = "i can\'t " + Let keywords(9).index = 8 + Let keywords(10).keyword = "i am " + Let keywords(10).index = 9 + Let keywords(11).keyword = "i\'m " + Let keywords(11).index = 9 + Let keywords(12).keyword = "you " + Let keywords(12).index = 10 + Let keywords(13).keyword = "i want " + Let keywords(13).index = 11 + Let keywords(14).keyword = "what " + Let keywords(14).index = 12 + Let keywords(15).keyword = "how " + Let keywords(15).index = 12 + Let keywords(16).keyword = "who " + Let keywords(16).index = 12 + Let keywords(17).keyword = "where " + Let keywords(17).index = 12 + Let keywords(18).keyword = "when " + Let keywords(18).index = 12 + Let keywords(19).keyword = "why " + Let keywords(19).index = 12 + Let keywords(20).keyword = "name " + Let keywords(20).index = 13 + Let keywords(21).keyword = "cause " + Let keywords(21).index = 14 + Let keywords(22).keyword = "sorry " + Let keywords(22).index = 15 + Let keywords(23).keyword = "dream " + Let keywords(23).index = 16 + Let keywords(24).keyword = "hello " + Let keywords(24).index = 17 + Let keywords(25).keyword = "hi " + Let keywords(25).index = 17 + Let keywords(26).keyword = "maybe " + Let keywords(26).index = 18 + Let keywords(27).keyword = " no" + Let keywords(27).index = 19 + Let keywords(28).keyword = "your " + Let keywords(28).index = 20 + Let keywords(29).keyword = "always " + Let keywords(29).index = 21 + Let keywords(30).keyword = "think " + Let keywords(30).index = 22 + Let keywords(31).keyword = "alike " + Let keywords(31).index = 23 + Let keywords(32).keyword = "yes " + Let keywords(32).index = 24 + Let keywords(33).keyword = "friend " + Let keywords(33).index = 25 + Let keywords(34).keyword = "computer" + Let keywords(34).index = 26 + Let keywords(35).keyword = "bot " + Let keywords(35).index = 26 + Let keywords(36).keyword = "smartphone" + Let keywords(36).index = 27 + Let keywords(37).keyword = "father " + Let keywords(37).index = 28 + Let keywords(38).keyword = "mother " + Let keywords(38).index = 28 + return keywords +End Function +Rem +Rem Returns an array of pairs of mutualy substitutable +Rem TODO: Check (and specify if needed) the argument and result types! +Function setupReflexions() As String(50,0 To 1) + Rem TODO: Check and accomplish your variable declarations here: + Dim reflexions(,) As String + Rem + Let reflexions(0) = Array(" are ", " am ") + Let reflexions(1) = Array(" were ", " was ") + Let reflexions(2) = Array(" you ", " I ") + Let reflexions(3) = Array(" your", " my") + Let reflexions(4) = Array(" i\'ve ", " you\'ve ") + Let reflexions(5) = Array(" i\'m ", " you\'re ") + Let reflexions(6) = Array(" me ", " you ") + Let reflexions(7) = Array(" my ", " your ") + Let reflexions(8) = Array(" i ", " you ") + Let reflexions(9) = Array(" am ", " are ") + return reflexions +End Function +Rem +Rem This routine sets up the reply rings addressed by the key words defined in +Rem routine `setupKeywords()´ and mapped hitherto by the cross table defined +Rem in `setupMapping()´ +Rem TODO: Check (and specify if needed) the argument and result types! +Function setupReplies() As String(50,50) + Rem TODO: Check and accomplish your variable declarations here: + Dim setupReplies(,) As String + Dim replies(,) As String + Rem + Rem We start with the highest index for performance reasons + Rem (is to avoid frequent array resizing) + Let replies(29) = Array( "Say, do you have any psychological problems?", "What does that suggest to you?", "I see.", "I'm not sure I understand you fully.", "Come come elucidate your thoughts.", "Can you elaborate on that?", "That is quite interesting.") + Let replies(0) = Array( "Don't you believe that I can*?", "Perhaps you would like to be like me?", "You want me to be able to*?") + Let replies(1) = Array( "Perhaps you don't want to*?", "Do you want to be able to*?") + Let replies(2) = Array( "What makes you think I am*?", "Does it please you to believe I am*?", "Perhaps you would like to be*?", "Do you sometimes wish you were*?") + Let replies(3) = Array( "Don't you really*?", "Why don't you*?", "Do you wish to be able to*?", "Does that trouble you*?") + Let replies(4) = Array( "Do you often feel*?", "Are you afraid of feeling*?", "Do you enjoy feeling*?") + Let replies(5) = Array( "Do you really believe I don't*?", "Perhaps in good time I will*.", "Do you want me to*?") + Let replies(6) = Array( "Do you think you should be able to*?", "Why can't you*?") + Let replies(7) = Array( "Why are you interested in whether or not I am*?", "Would you prefer if I were not*?", "Perhaps in your fantasies I am*?") + Let replies(8) = Array( "How do you know you can't*?", "Have you tried?","Perhaps you can now*.") + Let replies(9) = Array( "Did you come to me because you are*?", "How long have you been*?", "Do you believe it is normal to be*?", "Do you enjoy being*?") + Let replies(10) = Array( "We were discussing you--not me.", "Oh, I*.", "You're not really talking about me, are you?") + Let replies(11) = Array( "What would it mean to you if you got*?", "Why do you want*?", "Suppose you soon got*...", "What if you never got*?", "I sometimes also want*.") + Let replies(12) = Array( "Why do you ask?", "Does that question interest you?", "What answer would please you the most?", "What do you think?", "Are such questions on your mind often?", "What is it that you really want to know?", "Have you asked anyone else?", "Have you asked such questions before?", "What else comes to mind when you ask that?") + Let replies(13) = Array( "Names don't interest me.", "I don't care about names -- please go on.") + Let replies(14) = Array( "Is that the real reason?", "Don't any other reasons come to mind?", "Does that reason explain anything else?", "What other reasons might there be?") + Let replies(15) = Array( "Please don't apologize!", "Apologies are not necessary.", "What feelings do you have when you apologize?", "Don't be so defensive!") + Let replies(16) = Array( "What does that dream suggest to you?", "Do you dream often?", "What persons appear in your dreams?", "Are you disturbed by your dreams?") + Let replies(17) = Array( "How do you do ...please state your problem.") + Let replies(18) = Array( "You don't seem quite certain.", "Why the uncertain tone?", "Can't you be more positive?", "You aren't sure?", "Don't you know?") + Let replies(19) = Array( "Are you saying no just to be negative?", "You are being a bit negative.", "Why not?", "Are you sure?", "Why no?") + Let replies(20) = Array( "Why are you concerned about my*?", "What about your own*?") + Let replies(21) = Array( "Can you think of a specific example?", "When?", "What are you thinking of?", "Really, always?") + Let replies(22) = Array( "Do you really think so?", "But you are not sure you*?", "Do you doubt you*?") + Let replies(23) = Array( "In what way?", "What resemblance do you see?", "What does the similarity suggest to you?", "What other connections do you see?", "Could there really be some connection?", "How?", "You seem quite positive.") + Let replies(24) = Array( "Are you sure?", "I see.", "I understand.") + Let replies(25) = Array( "Why do you bring up the topic of friends?", "Do your friends worry you?", "Do your friends pick on you?", "Are you sure you have any friends?", "Do you impose on your friends?", "Perhaps your love for friends worries you.") + Let replies(26) = Array( "Do computers worry you?", "Are you talking about me in particular?", "Are you frightened by machines?", "Why do you mention computers?", "What do you think machines have to do with your problem?", "Don't you think computers can help people?", "What is it about machines that worries you?") + Let replies(27) = Array( "Do you sometimes feel uneasy without a smartphone?", "Have you had these phantasies before?", "Does the world seem more real for you via apps?") + Let replies(28) = Array( "Tell me more about your family.", "Who else in your family*?", "What does family relations mean for you?", "Come on, How old are you?") + setupReplies = replies + Return setupReplies +End Function diff --git a/samples/export/BASIC1/SORTING_TEST_MAIN.bas b/samples/export/BASIC1/SORTING_TEST_MAIN.bas index 12191a40..1f040f15 100644 --- a/samples/export/BASIC1/SORTING_TEST_MAIN.bas +++ b/samples/export/BASIC1/SORTING_TEST_MAIN.bas @@ -2,7 +2,7 @@ Rem Creates three equal arrays of numbers and has them sorted with different sor Rem to allow performance comparison via execution counting ("Collect Runtime Data" should Rem sensibly be switched on). Rem Requested input data are: Number of elements (size) and filing mode. -Rem Generated by Structorizer 3.32-01 +Rem Generated by Structorizer 3.32-04 Rem Copyright (C) 2019-10-02 Kay Gürtzig Rem License: GPLv3-link diff --git a/samples/export/C#/ELIZA_2.3.cs b/samples/export/C#/ELIZA_2.3.cs index d6fc878a..785a3a63 100644 --- a/samples/export/C#/ELIZA_2.3.cs +++ b/samples/export/C#/ELIZA_2.3.cs @@ -1,4 +1,4 @@ -// Generated by Structorizer 3.32-01 +// Generated by Structorizer 3.32-04 // Copyright (C) 2018-05-14 Kay Gürtzig // License: GPLv3-link diff --git a/samples/export/C#/SORTING_TEST_MAIN.cs b/samples/export/C#/SORTING_TEST_MAIN.cs index 7a8f9321..50b61739 100644 --- a/samples/export/C#/SORTING_TEST_MAIN.cs +++ b/samples/export/C#/SORTING_TEST_MAIN.cs @@ -1,4 +1,4 @@ -// Generated by Structorizer 3.32-01 +// Generated by Structorizer 3.32-04 // Copyright (C) 2019-10-02 Kay Gürtzig // License: GPLv3-link @@ -18,10 +18,10 @@ public class SORTING_TEST_MAIN { // =========== START PARALLEL WORKER DEFINITIONS ============ - class Worker465fbb06_0{ + class Worker1b4c8697_0{ // TODO: Check and accomplish the member declarations here private int[] values1; - public Worker465fbb06_0(int[] values1) + public Worker1b4c8697_0(int[] values1) { this.values1 = values1; } @@ -31,11 +31,11 @@ public void DoWork() } }; - class Worker465fbb06_1{ + class Worker1b4c8697_1{ // TODO: Check and accomplish the member declarations here private int[] values2; private ??? elementCount; - public Worker465fbb06_1(int[] values2, ??? elementCount) + public Worker1b4c8697_1(int[] values2, ??? elementCount) { this.values2 = values2; this.elementCount = elementCount; @@ -46,10 +46,10 @@ public void DoWork() } }; - class Worker465fbb06_2{ + class Worker1b4c8697_2{ // TODO: Check and accomplish the member declarations here private int[] values3; - public Worker465fbb06_2(int[] values3) + public Worker1b4c8697_2(int[] values3) { this.values3 = values3; } @@ -61,12 +61,12 @@ public void DoWork() // ============ END PARALLEL WORKER DEFINITIONS ============= // =========== START PARALLEL WORKER DEFINITIONS ============ - class Worker98a2d384_0{ + class Worker1151c3b_0{ // TODO: Check and accomplish the member declarations here private ??? values; private ??? start; private ??? p; - public Worker98a2d384_0(??? values, ??? start, ??? p) + public Worker1151c3b_0(??? values, ??? start, ??? p) { this.values = values; this.start = start; @@ -79,12 +79,12 @@ public void DoWork() } }; - class Worker98a2d384_1{ + class Worker1151c3b_1{ // TODO: Check and accomplish the member declarations here private ??? values; private ??? p; private ??? stop; - public Worker98a2d384_1(??? values, ??? p, ??? stop) + public Worker1151c3b_1(??? values, ??? p, ??? stop) { this.values = values; this.p = p; @@ -146,21 +146,21 @@ public static void Main(string[] args) { // ================= START PARALLEL SECTION ================= // ========================================================== { - Worker465fbb06_0 worker465fbb06_0 = new Worker465fbb06_0(values1); - Thread thr465fbb06_0 = new Thread(worker465fbb06_0.DoWork); - thr465fbb06_0.Start(); + Worker1b4c8697_0 worker1b4c8697_0 = new Worker1b4c8697_0(values1); + Thread thr1b4c8697_0 = new Thread(worker1b4c8697_0.DoWork); + thr1b4c8697_0.Start(); - Worker465fbb06_1 worker465fbb06_1 = new Worker465fbb06_1(values2, elementCount); - Thread thr465fbb06_1 = new Thread(worker465fbb06_1.DoWork); - thr465fbb06_1.Start(); + Worker1b4c8697_1 worker1b4c8697_1 = new Worker1b4c8697_1(values2, elementCount); + Thread thr1b4c8697_1 = new Thread(worker1b4c8697_1.DoWork); + thr1b4c8697_1.Start(); - Worker465fbb06_2 worker465fbb06_2 = new Worker465fbb06_2(values3); - Thread thr465fbb06_2 = new Thread(worker465fbb06_2.DoWork); - thr465fbb06_2.Start(); + Worker1b4c8697_2 worker1b4c8697_2 = new Worker1b4c8697_2(values3); + Thread thr1b4c8697_2 = new Thread(worker1b4c8697_2.DoWork); + thr1b4c8697_2.Start(); - thr465fbb06_0.Join(); - thr465fbb06_1.Join(); - thr465fbb06_2.Join(); + thr1b4c8697_0.Join(); + thr1b4c8697_1.Join(); + thr1b4c8697_2.Join(); } // ========================================================== // ================== END PARALLEL SECTION ================== @@ -372,16 +372,16 @@ private static void quickSort(??? values, ??? start, ??? stop) { // ================= START PARALLEL SECTION ================= // ========================================================== { - Worker98a2d384_0 worker98a2d384_0 = new Worker98a2d384_0(values, start, p); - Thread thr98a2d384_0 = new Thread(worker98a2d384_0.DoWork); - thr98a2d384_0.Start(); + Worker1151c3b_0 worker1151c3b_0 = new Worker1151c3b_0(values, start, p); + Thread thr1151c3b_0 = new Thread(worker1151c3b_0.DoWork); + thr1151c3b_0.Start(); - Worker98a2d384_1 worker98a2d384_1 = new Worker98a2d384_1(values, p, stop); - Thread thr98a2d384_1 = new Thread(worker98a2d384_1.DoWork); - thr98a2d384_1.Start(); + Worker1151c3b_1 worker1151c3b_1 = new Worker1151c3b_1(values, p, stop); + Thread thr1151c3b_1 = new Thread(worker1151c3b_1.DoWork); + thr1151c3b_1.Start(); - thr98a2d384_0.Join(); - thr98a2d384_1.Join(); + thr1151c3b_0.Join(); + thr1151c3b_1.Join(); } // ========================================================== // ================== END PARALLEL SECTION ================== diff --git a/samples/export/C++/ELIZA_2.3.cpp b/samples/export/C++/ELIZA_2.3.cpp index 224ded8d..98c4a350 100644 --- a/samples/export/C++/ELIZA_2.3.cpp +++ b/samples/export/C++/ELIZA_2.3.cpp @@ -1,4 +1,4 @@ -// Generated by Structorizer 3.32-01 +// Generated by Structorizer 3.32-04 // Copyright (C) 2018-05-14 Kay Gürtzig // License: GPLv3-link diff --git a/samples/export/C++/SORTING_TEST_MAIN.cpp b/samples/export/C++/SORTING_TEST_MAIN.cpp index 682e6240..b16cb5a3 100644 --- a/samples/export/C++/SORTING_TEST_MAIN.cpp +++ b/samples/export/C++/SORTING_TEST_MAIN.cpp @@ -1,4 +1,4 @@ -// Generated by Structorizer 3.32-01 +// Generated by Structorizer 3.32-04 // Copyright (C) 2019-10-02 Kay Gürtzig // License: GPLv3-link @@ -176,7 +176,7 @@ void buildMaxHeap(??? heap) // TODO: Revise the return type and declare the parameters. void quickSort(??? values, ??? start, ??? stop) { - class ThrFunc98a2d384_0{ + class ThrFunc1151c3b_0{ public: void operator()(???& values, ???& start, ???& p) { // Sort left (lower) array part @@ -184,7 +184,7 @@ void quickSort(??? values, ??? start, ??? stop) } }; - class ThrFunc98a2d384_1{ + class ThrFunc1151c3b_1{ public: void operator()(???& values, ???& p, ???& stop) { // Sort right (higher) array part @@ -208,14 +208,14 @@ void quickSort(??? values, ??? start, ??? stop) // Parallel section { - ThrFunc98a2d384_0 thrfunc98a2d384_0; - std::thread thr98a2d384_0(thrfunc98a2d384_0, values, start, p); + ThrFunc1151c3b_0 thrfunc1151c3b_0; + std::thread thr1151c3b_0(thrfunc1151c3b_0, values, start, p); - ThrFunc98a2d384_1 thrfunc98a2d384_1; - std::thread thr98a2d384_1(thrfunc98a2d384_1, values, p, stop); + ThrFunc1151c3b_1 thrfunc1151c3b_1; + std::thread thr1151c3b_1(thrfunc1151c3b_1, values, p, stop); - thr98a2d384_0.join(); - thr98a2d384_1.join(); + thr1151c3b_0.join(); + thr1151c3b_1.join(); } } @@ -250,21 +250,21 @@ void heapSort(??? values) // Requested input data are: Number of elements (size) and filing mode. int main(void) { - class ThrFunc465fbb06_0{ + class ThrFunc1b4c8697_0{ public: void operator()(int values1[50]) { bubbleSort(values1); } }; - class ThrFunc465fbb06_1{ + class ThrFunc1b4c8697_1{ public: void operator()(int values2[50], ???& elementCount) { quickSort(values2, 0, elementCount); } }; - class ThrFunc465fbb06_2{ + class ThrFunc1b4c8697_2{ public: void operator()(int values3[50]) { heapSort(values3); @@ -309,18 +309,18 @@ int main(void) // Parallel section { - ThrFunc465fbb06_0 thrfunc465fbb06_0; - std::thread thr465fbb06_0(thrfunc465fbb06_0, values1); + ThrFunc1b4c8697_0 thrfunc1b4c8697_0; + std::thread thr1b4c8697_0(thrfunc1b4c8697_0, values1); - ThrFunc465fbb06_1 thrfunc465fbb06_1; - std::thread thr465fbb06_1(thrfunc465fbb06_1, values2, elementCount); + ThrFunc1b4c8697_1 thrfunc1b4c8697_1; + std::thread thr1b4c8697_1(thrfunc1b4c8697_1, values2, elementCount); - ThrFunc465fbb06_2 thrfunc465fbb06_2; - std::thread thr465fbb06_2(thrfunc465fbb06_2, values3); + ThrFunc1b4c8697_2 thrfunc1b4c8697_2; + std::thread thr1b4c8697_2(thrfunc1b4c8697_2, values3); - thr465fbb06_0.join(); - thr465fbb06_1.join(); - thr465fbb06_2.join(); + thr1b4c8697_0.join(); + thr1b4c8697_1.join(); + thr1b4c8697_2.join(); } ok1 = testSorted(values1); diff --git a/samples/export/C/ELIZA_2.3.c b/samples/export/C/ELIZA_2.3.c index 8e1796eb..99b576c5 100644 --- a/samples/export/C/ELIZA_2.3.c +++ b/samples/export/C/ELIZA_2.3.c @@ -1,5 +1,5 @@ // program ELIZA -// Generated by Structorizer 3.32-01 +// Generated by Structorizer 3.32-04 // Copyright (C) 2018-05-14 Kay Gürtzig // License: GPLv3-link @@ -75,10 +75,10 @@ char* adjustSpelling(char* sentence) insert(uppercase(start), result, 1); } { - char* arraydbdbf287[2] = {" i ", " i\'"}; - int indexdbdbf287; - for (indexdbdbf287 = 0; indexdbdbf287 < 2; indexdbdbf287++) { - char* word = arraydbdbf287[indexdbdbf287]; + char* arraya8345b26[2] = {" i ", " i\'"}; + int indexa8345b26; + for (indexa8345b26 = 0; indexa8345b26 < 2; indexa8345b26++) { + char* word = arraya8345b26[indexa8345b26]; position = pos(word, result); while (position > 0) { delete(result, position+1, 1); @@ -109,10 +109,10 @@ bool checkGoodBye(char* text, char* phrases[50][2]) { // TODO: Find out and fill in the number of elements of the array phrases here! - int countc301598b = ???; - int indexc301598b; - for (indexc301598b = 0; indexc301598b < countc301598b; indexc301598b++) { - char* pair[] = phrases[indexc301598b]; + int count98b6f191 = ???; + int index98b6f191; + for (index98b6f191 = 0; index98b6f191 < count98b6f191; index98b6f191++) { + char* pair[] = phrases[index98b6f191]; if (pos(pair[0], text) > 0) { // TODO: check format specifiers, replace all '?'! printf("%?\n", pair[1]); @@ -166,10 +166,10 @@ char* conjugateStrings(char* sentence, char* key, int keyPos, char* flexions[50] result = " " + copy(sentence, keyPos + length(key), length(sentence)) + " "; { // TODO: Find out and fill in the number of elements of the array flexions here! - int counta29a4c2f = ???; - int indexa29a4c2f; - for (indexa29a4c2f = 0; indexa29a4c2f < counta29a4c2f; indexa29a4c2f++) { - char* pair[] = flexions[indexa29a4c2f]; + int countf1e81577 = ???; + int indexf1e81577; + for (indexf1e81577 = 0; indexf1e81577 < countf1e81577; indexf1e81577++) { + char* pair[] = flexions[indexf1e81577]; left = ""; right = result; position = pos(pair[0], right); @@ -242,10 +242,10 @@ char* normalizeInput(char* sentence) sentence = lowercase(sentence); { - char arraybd738552[5] = {'.', ',', ';', '!', '?'}; - int indexbd738552; - for (indexbd738552 = 0; indexbd738552 < 5; indexbd738552++) { - char symbol = arraybd738552[indexbd738552]; + char arrayeb858363[5] = {'.', ',', ';', '!', '?'}; + int indexeb858363; + for (indexeb858363 = 0; indexeb858363 < 5; indexeb858363++) { + char symbol = arrayeb858363[indexeb858363]; position = pos(symbol, sentence); while (position > 0) { sentence = copy(sentence, 1, position-1) + copy(sentence, position+1, length(sentence)); diff --git a/samples/export/C/SORTING_TEST_MAIN.c b/samples/export/C/SORTING_TEST_MAIN.c index 6b069562..3917fed8 100644 --- a/samples/export/C/SORTING_TEST_MAIN.c +++ b/samples/export/C/SORTING_TEST_MAIN.c @@ -1,5 +1,5 @@ // program SORTING_TEST_MAIN -// Generated by Structorizer 3.32-01 +// Generated by Structorizer 3.32-04 // Copyright (C) 2019-10-02 Kay Gürtzig // License: GPLv3-link diff --git a/samples/export/Java/ELIZA_2.3.java b/samples/export/Java/ELIZA_2.3.java index 7316f4a4..923589ca 100644 --- a/samples/export/Java/ELIZA_2.3.java +++ b/samples/export/Java/ELIZA_2.3.java @@ -1,4 +1,4 @@ -// Generated by Structorizer 3.32-01 +// Generated by Structorizer 3.32-04 // Copyright (C) 2018-05-14 Kay Gürtzig // License: GPLv3-link diff --git a/samples/export/Java/SORTING_TEST_MAIN.java b/samples/export/Java/SORTING_TEST_MAIN.java index 7becbc58..a617f207 100644 --- a/samples/export/Java/SORTING_TEST_MAIN.java +++ b/samples/export/Java/SORTING_TEST_MAIN.java @@ -1,4 +1,4 @@ -// Generated by Structorizer 3.32-01 +// Generated by Structorizer 3.32-04 // Copyright (C) 2019-10-02 Kay Gürtzig // License: GPLv3-link @@ -26,9 +26,9 @@ public class SORTING_TEST_MAIN { public static void main(String[] args) { // =========== START PARALLEL WORKER DEFINITIONS ============ - class Worker465fbb06_0 implements Callable { + class Worker1b4c8697_0 implements Callable { private int[] values1; - public Worker465fbb06_0(int[] values1) { + public Worker1b4c8697_0(int[] values1) { this.values1 = values1; } public Object[] call() throws Exception { @@ -37,10 +37,10 @@ public Object[] call() throws Exception { } }; - class Worker465fbb06_1 implements Callable { + class Worker1b4c8697_1 implements Callable { private int[] values2; private ??? elementCount; - public Worker465fbb06_1(int[] values2, ??? elementCount) { + public Worker1b4c8697_1(int[] values2, ??? elementCount) { this.values2 = values2; this.elementCount = elementCount; } @@ -50,9 +50,9 @@ public Object[] call() throws Exception { } }; - class Worker465fbb06_2 implements Callable { + class Worker1b4c8697_2 implements Callable { private int[] values3; - public Worker465fbb06_2(int[] values3) { + public Worker1b4c8697_2(int[] values3) { this.values3 = values3; } public Object[] call() throws Exception { @@ -109,20 +109,20 @@ public Object[] call() throws Exception { ExecutorService pool = Executors.newFixedThreadPool(3); // ----------------- START THREAD 0 ----------------- - Future future465fbb06_0 = pool.submit( new Worker465fbb06_0(values1) ); + Future future1b4c8697_0 = pool.submit( new Worker1b4c8697_0(values1) ); // ----------------- START THREAD 1 ----------------- - Future future465fbb06_1 = pool.submit( new Worker465fbb06_1(values2, elementCount) ); + Future future1b4c8697_1 = pool.submit( new Worker1b4c8697_1(values2, elementCount) ); // ----------------- START THREAD 2 ----------------- - Future future465fbb06_2 = pool.submit( new Worker465fbb06_2(values3) ); + Future future1b4c8697_2 = pool.submit( new Worker1b4c8697_2(values3) ); // ----------------- AWAIT THREAD 0 ----------------- - future465fbb06_0.get(); + future1b4c8697_0.get(); // ----------------- AWAIT THREAD 1 ----------------- - future465fbb06_1.get(); + future1b4c8697_1.get(); // ----------------- AWAIT THREAD 2 ----------------- - future465fbb06_2.get(); + future1b4c8697_2.get(); pool.shutdown(); } catch (Exception ex) { System.err.println(ex.getMessage()); ex.printStackTrace(); } @@ -319,11 +319,11 @@ private static void buildMaxHeap(??? heap) { */ private static void quickSort(??? values, ??? start, ??? stop) { // =========== START PARALLEL WORKER DEFINITIONS ============ - class Worker98a2d384_0 implements Callable { + class Worker1151c3b_0 implements Callable { private ??? values; private ??? start; private ??? p; - public Worker98a2d384_0(??? values, ??? start, ??? p) { + public Worker1151c3b_0(??? values, ??? start, ??? p) { this.values = values; this.start = start; this.p = p; @@ -335,11 +335,11 @@ public Object[] call() throws Exception { } }; - class Worker98a2d384_1 implements Callable { + class Worker1151c3b_1 implements Callable { private ??? values; private ??? p; private ??? stop; - public Worker98a2d384_1(??? values, ??? p, ??? stop) { + public Worker1151c3b_1(??? values, ??? p, ??? stop) { this.values = values; this.p = p; this.stop = stop; @@ -373,15 +373,15 @@ public Object[] call() throws Exception { ExecutorService pool = Executors.newFixedThreadPool(2); // ----------------- START THREAD 0 ----------------- - Future future98a2d384_0 = pool.submit( new Worker98a2d384_0(values, start, p) ); + Future future1151c3b_0 = pool.submit( new Worker1151c3b_0(values, start, p) ); // ----------------- START THREAD 1 ----------------- - Future future98a2d384_1 = pool.submit( new Worker98a2d384_1(values, p, stop) ); + Future future1151c3b_1 = pool.submit( new Worker1151c3b_1(values, p, stop) ); // ----------------- AWAIT THREAD 0 ----------------- - future98a2d384_0.get(); + future1151c3b_0.get(); // ----------------- AWAIT THREAD 1 ----------------- - future98a2d384_1.get(); + future1151c3b_1.get(); pool.shutdown(); } catch (Exception ex) { System.err.println(ex.getMessage()); ex.printStackTrace(); } diff --git a/samples/export/Js/ELIZA_2.3.js b/samples/export/Js/ELIZA_2.3.js index be361426..559c69ea 100644 --- a/samples/export/Js/ELIZA_2.3.js +++ b/samples/export/Js/ELIZA_2.3.js @@ -1,6 +1,6 @@