Created
October 29, 2016 13:16
-
-
Save iyahoo/04087b02996ee0156ab995764ff68e0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#|-*- mode:lisp -*-|# | |
#| | |
exec ros -Q -- $0 "$@" | |
|# | |
(defun main (n &rest argv) | |
(declare (ignore argv)) | |
(let* ((nth (parse-integer n)) | |
(adj-mat (make-array (list nth nth)))) | |
(loop :for i :to (1- nth) :do | |
(loop :for j :from i :to (1- nth) :do | |
(if (= i j) | |
(setf (aref adj-mat i j) 0) | |
(let ((random-number (random 10))) | |
(setf (aref adj-mat i j) random-number) | |
(setf (aref adj-mat j i) random-number))))) | |
(format t "~a~%" adj-mat))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment