Skip to content

Commit

Permalink
Merge pull request #337 from PESchoenberg/develop
Browse files Browse the repository at this point in the history
New functions.
  • Loading branch information
PESchoenberg authored Dec 23, 2023
2 parents c63dd54 + ea07569 commit 50b2d4f
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 10 deletions.
38 changes: 36 additions & 2 deletions grsp1.scm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@

(define-module (grsp grsp1)
#:use-module (grsp grsp0)
#:export (gconst))
#:export (gconst
gconsten))


;;;; gconst - Various constants.
Expand Down Expand Up @@ -130,7 +131,7 @@
;; [Accessed 4 November 2020].


;;;; gconst - Constants.
;;;; gconst - Constants, numeric.
;;
;; Keywords:
;;
Expand Down Expand Up @@ -1091,3 +1092,36 @@

res))


;;;; gconsten - Constants, strings, in English.
;;
;; Keywords:
;;
;; - constants.
;;
;; Parameters:
;;
;; - p_s1: string, constant identifier.
;;
(define (gconsten p_s1)
(let ((res1 ""))

(cond ((equal? p_s1 "hw")
(set! res1 "Hello world!"))
((equal? p_s1 "pdf")
(set! res1 "See docs for details."))
((equal? p_s1 "pec")
(set! res1 "Press <ENT> to continue."))
((equal? p_s1 "opt")
(set! res1 "? "))
((equal? p_s1 "ged")
(set! res1 "Getting data..."))
((equal? p_s1 "plw")
(set! res1 "Please wait..."))
((equal? p_s1 "fin")
(set! res1 "Finished!"))
((equal? p_s1 "bmm")
(set! res1 "Back to main menu!\n")))

res1))

32 changes: 24 additions & 8 deletions grsp3.scm
Original file line number Diff line number Diff line change
Expand Up @@ -11411,25 +11411,38 @@
;;
(define (grsp-matrix-inputev p_b1 p_b2 p_a1 p_i1 p_j1)
(let ((res1 0)
(res2 0)
(s1 "")
(s2 "")
(s3 "")
(s4 "")
(s5 "")
(n1 0))

(set! res1 (grsp-matrix-cpy p_a1))

(set! res2 (grsp-matrix-cpy p_a1))
(set! res1 (grsp-my2ms res2))

(cond ((equal? p_b1 #t)
(clear)
(grsp-ldl "Matrix before updating:" 0 0)
(grsp-matrix-display res1)))

(set! s1 (strings-append (list "Value for element ["

(set! s5 (array-ref res1 p_i1 p_j1))
(set! s4 (strings-append (list "Current value for element ["
(grsp-n2s p_i1)
", "
(grsp-n2s p_j1)
"]?")
"] "
s5)
0))

(set! s1 (strings-append (list "New value for element ["
(grsp-n2s p_i1)
", "
(grsp-n2s p_j1)
"]? ")
0))

(grsp-ldl s4 1 1)
(set! s2 (grsp-ask s1))

(cond ((symbol? s2)
Expand Down Expand Up @@ -11747,11 +11760,12 @@

;; Safety copy.
(set! a1 (grsp-matrix-cpy p_a1))
;; ***

(while (equal? b1 #t)

(clear)

(system "tput cup 0")

;; Assign default values if matrix has one row filled with zeros,
;; meaning that it has just been created.
(cond ((equal? (grsp-tm a1) 1)
Expand Down Expand Up @@ -12571,3 +12585,5 @@
(loop (+ i1 1)))))

res1))


0 comments on commit 50b2d4f

Please sign in to comment.