umka-lang icon indicating copy to clipboard operation
umka-lang copied to clipboard

Shadowed variable warning or error

Open vtereshkov opened this issue 11 months ago • 0 comments

Spot the bug:

fn main() {
    n := 3

    plt := umplot::init(4)

    plt.series[1].style.kind = .scatter
    plt.series[2].style.kind = .scatter 
    plt.series[3].style.kind = .scatter 
    plt.series[3].style.width = 5   

    f, err := std::fopen(sprintf("%drounds.log", n), "r")
    std::exitif(err)

    for !std::feof(f) {
    	var x, y: real
    	n := fscanf(f, "%lf %lf\n", &x, &y)
    	std::assert(n == 2)

    	plt.series[0].add(x, y)
    	plt.series[1].add(x, y)
    	plt.series[2].add(x, probFine(x, n))
    }

    for k := 0; k <= n; k++ {
    	plt.series[3].add(goldCoarse(k, n), probCoarse(k, n))
    }

    std::fclose(f)

    plt.plot()
}

vtereshkov avatar Dec 29 '24 17:12 vtereshkov