First stab at heightmaps. Needs work.
author |
Steve Losh <steve@stevelosh.com> |
date |
Sat, 03 Feb 2018 14:40:16 -0500 |
parents |
8ae9290fdd58
|
children |
9bd6c3377af8
|
branches/tags |
(none) |
files |
Makefile magitek.asd package.lisp src/main.lisp |
Changes
--- a/Makefile Sat Nov 11 13:10:41 2017 -0500
+++ b/Makefile Sat Feb 03 14:40:16 2018 -0500
@@ -22,8 +22,9 @@
# Server
update-deps:
- hg -R /home/sjl/lib/cl-losh -v pull -u
- hg -R /home/sjl/lib/chancery -v pull -u
+ hg -R /home/sjl/lib/cl-losh -v pull -u
+ hg -R /home/sjl/lib/chancery -v pull -u
+ hg -R /home/sjl/lib/trivial-ppm -v pull -u
# Local
deploy: binary
--- a/magitek.asd Sat Nov 11 13:10:41 2017 -0500
+++ b/magitek.asd Sat Feb 03 14:40:16 2018 -0500
@@ -19,6 +19,7 @@
:sqlite
:trivia
:trivia.quasiquote
+ :trivial-ppm
)
@@ -37,6 +38,7 @@
(:file "database")
(:file "twitter")
(:file "markov")
+ (:file "diamond-square")
(:module "robots"
:components ((:file "git-commands")
(:file "lisp-talks")
--- a/package.lisp Sat Nov 11 13:10:41 2017 -0500
+++ b/package.lisp Sat Feb 03 14:40:16 2018 -0500
@@ -33,6 +33,15 @@
:build-markov-generator
:generate-sentence))
+(defpackage :magitek.diamond-square
+ (:use
+ :cl
+ :losh
+ :iterate
+ :magitek.quickutils)
+ (:export
+ :generate-heightmap))
+
(defpackage :magitek.robots.git-commands
(:use
--- a/src/main.lisp Sat Nov 11 13:10:41 2017 -0500
+++ b/src/main.lisp Sat Feb 03 14:40:16 2018 -0500
@@ -41,7 +41,7 @@
(finding (funcall generator) :such-that #'tt-tweetable-p)))
-(defun run-bot (bot &key (force nil) (dry nil))
+(defun run-bot (bot &key (force nil) (dry t))
(with-bot (bot)
(format t "Running ~S~%" name)
(when (or force
@@ -52,9 +52,11 @@
(progn
(format t "Tweeting as ~S: ~S~%" name tweet)
(db-insert-tweet name tweet)
- (unless dry
- (tt-tweet name tweet)
- (sleep 5.0))))))))
+ (if dry
+ (format t "Skipping actual tweet (dry run).")
+ (progn
+ (tt-tweet name tweet)
+ (sleep 5.0)))))))))
(defun spinup ()
@@ -65,7 +67,7 @@
(defun main ()
(setf *random-state* (make-random-state t))
(spinup)
- (run-bot *frantic-barista*)
- (run-bot *git-commands*)
- (run-bot *lisp-talks*)
- (run-bot *rpg-shopkeeper*))
+ (run-bot *frantic-barista* :dry nil)
+ (run-bot *git-commands* :dry nil)
+ (run-bot *lisp-talks* :dry nil)
+ (run-bot *rpg-shopkeeper* :dry nil))