小编Ben*_*eem的帖子

Visual Studio无法构建为exe(.NET Core 2.0)

如果我在Visual Studio中有一个基本的C#程序,例如

public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
Run Code Online (Sandbox Code Playgroud)

我在Visual Studio中构建项目,但得到的是.dll而不是.exe。我已经在该项目的属性页中进行了查找,并且Output类型设置为Console Application。我也尝试过Windows应用程序和类库,但是它们都创建了一个dll。如果有关系,我的目标框架是.NET Core 2.0。不知道还会导致什么。

c# visual-studio .net-core visual-studio-2017 .net-core-2.0

4
推荐指数
1
解决办法
721
查看次数

如果我在F#中有自定义列表类型,我如何得到该类型列表的头部和尾部

我在F#中有一个自定义列表,例如:

type 'element mylist = NIL | CONS of 'element * 'element mylist
Run Code Online (Sandbox Code Playgroud)

我想使用类似的东西来反转这种类型的列表

let rec helperOld a b =
    match a with
    | [] -> b
    | h::t -> helperOld t (h::b)

let revOld L = helperOld L []
Run Code Online (Sandbox Code Playgroud)

我到目前为止所做的就是做类似的事情

let rec helper a b = 
    match a with
    | NIL -> b
    | CONS(a, b) -> helper //tail of a, head of a cons b
Run Code Online (Sandbox Code Playgroud)

然而,我无法弄清楚如何获得尾部和头部.标准a.Head和a.Tail不起作用.如何在此自定义列表中访问这些元素?

f# reverse list

2
推荐指数
1
解决办法
118
查看次数

在 Java 中制作多个圆圈

我在课堂上有一个项目,我需要用简单的三个圆圈来显示交通灯。我从黄色的开始,然后尝试在其他一些随机的地方添加一个红色的,只是为了看看我是否可以做到,但是黄色的是唯一显示的。我不知道红色的是否在黄色的下面,但无论如何,为什么没有显示红色圆圈对我来说没有多大意义。

package tryingGraphicsStuff;
import javafx.application.Application; 
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.shape.Circle;
import javafx.scene.paint.*;
import javafx.scene.text.*;
import javafx.scene.control.*;

public class TryingGraphicsStuff extends Application{
    @Override
    public void start(Stage stage) throws Exception {
        // create circle
                Circle circle = new Circle(); 
                circle.setCenterX(150);
                circle.setCenterY(150);
                circle.setRadius(50);
                circle.setFill(Color.RED);
                // place on pane
                StackPane p = new StackPane();
                p.getChildren().add(circle);
                // ensure it stays centered if window resized
                //circle.centerXProperty().bind(p.widthProperty().divide(2)); 
                //circle.centerYProperty().bind(p.heightProperty().divide(2));

                Circle circleTwo = new Circle();
                circleTwo.setCenterX(400);
                circleTwo.setCenterY(400);
                circleTwo.setRadius(50);
                circleTwo.setFill(Color.YELLOW);
                // place on pane
                p.getChildren().add(circleTwo);


                // create …
Run Code Online (Sandbox Code Playgroud)

java javafx

-2
推荐指数
1
解决办法
3028
查看次数