我已经尝试了很长一段时间来显示NetLogo中乌龟的当前坐标.我知道要显示其中一个坐标,我可以使用:
show [xcor] of turtle 0
Run Code Online (Sandbox Code Playgroud)
要么
show [ycor] of turtle 0
Run Code Online (Sandbox Code Playgroud)
但是如何显示两个坐标呢?
谢谢.
我不知道为什么在调试项目后出现此错误,即使代码是默认的.
调节器
public class HomeController : Controller
{
//
// GET: /Home/
public ActionResult Index()
{
return View();
}
}
Run Code Online (Sandbox Code Playgroud)
视图
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<title>Index</title>
</head>
<body>
<div>
Hi
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
不知何故,在调试之后,请求的URL始终是/Views/Home/Index.cshtml,但通过浏览器访问Home是可以的.(HTTP://本地主机:58323 /家)
我用谷歌搜索,解决方案暗示问题在于全球.但那很奇怪,我不记得对它进行任何改动.
全球
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
Run Code Online (Sandbox Code Playgroud)
感谢任何帮助.谢谢
如何随机选择3个程序中的一个?
请看下面:
to move
ifelse random-float 100 < 70
[move-forward]
[move-left move-right move-back] ;; To randomly select one of these 3 procedures to execute.
end
Run Code Online (Sandbox Code Playgroud)
谢谢.我对语法很不熟悉.
正如标题所暗示的那样,希望在 0.3 < x < 0.7 之间的范围内生成一个随机浮点数。
我目前使用 while 循环来检查随机浮点数是否在该范围内。我想知道是否有更好的方法来做到这一点。