我有一个简单的bash脚本生成以下内容:
These are your winning lottery numbers:
27 6 29 17 15 47
19 16 33 15 20 14
29 34 48 19 33 40
Run Code Online (Sandbox Code Playgroud)
这是它的代码:
#!/bin/bash
tickets="$1"
function get_tickets { printf "How many tickets are you going to get? "; read tickets;}
function gen_numbers { printf "\nThese are your winning lottery numbers: \n";
for ((z=1 ; z<=tickets ; z++)); do
for ((i=0; i<6; i++ )); do
x=`echo $[ 1 + $[ RANDOM % 49 ]]`;
printf "\t $x";
done; …Run Code Online (Sandbox Code Playgroud) 我一直试图从其他帖子中弄清楚这一点,并且无法完全掌握它.这是我正在使用的代码:
<script type="text/javascript">
var mapOptions = {
center: new google.maps.LatLng(29.4814305, -98.5144044),
zoom: 10
};
var map = new google.maps.Map(document.getElementById("map-canvas"),
mapOptions);
var markers = [];
// Add a marker to the map and push to the array.
function addMarker(location) {
var marker = new google.maps.Marker({
position: location,
map: map,
draggable: false,
animation: google.maps.Animation.DROP
});
markers.push(marker);
}
// Sets the map on all markers in the array.
function setAllMap(map) {
for (var i = 0; i < markers.length; i++) {
markers[i].setMap(map);
} …Run Code Online (Sandbox Code Playgroud)