tfix domain dimensionality - Granular.jl - Julia package for granular dynamics simulation
HTML git clone git://src.adamsgaard.dk/Granular.jl
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 2ec4ebdc7253186e0faa49fb48f042393bd2dfcd
DIR parent a19e2a8c201bda48eafc46a2080e19f0a532c429
HTML Author: Anders Damsgaard <andersd@riseup.net>
Date: Tue, 12 Sep 2017 22:49:15 -0400
fix domain dimensionality
Diffstat:
M examples/logo.jl | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
DIR diff --git a/examples/logo.jl b/examples/logo.jl
t@@ -29,9 +29,16 @@ logo_string = readstring(`figlet -f pebbles "$text"`)
const dx = 1.
const dy = dx
-const nx = search(logo_string, '\n') - 1 + 2
const logo_string_split = split(logo_string, '\n')
-const ny = length(logo_string_split) + 1
+
+const ny = length(logo_string_split)
+maxwidth = 0
+for i=1:ny
+ if maxwidth < length(logo_string_split[i])
+ maxwidth = length(logo_string_split[i])
+ end
+end
+const nx = maxwidth + 1
const Lx = nx*dx
const Ly = ny*dy