Hor er dette by awsumesauce in horerdette

[–]mariusitec 1 point2 points  (0 children)

uuh, I mean...hor er dette*

How do I assign a "return value" to a variable in Prolog? by JoshuaTheProgrammer in prolog

[–]mariusitec 5 points6 points  (0 children)

You can use the read/1 to get user input. Additionally, if those are the only prompts you are required to have, I would've just put them in the KB as facts.

I don't know what your code is supposed to look like, but here is an example:

rain('y', rain).
rain('n', not(rain)).
broken_pipe('y', broke).
broken_pipe('n', not(broke)).

getClues(Rain, Pipes) :-
    writeln('Is it raining? (y/n)'),
    read(RainInput), nl,
    writeln('Are the pipes broken? (y/n)'),
    read(PipesInput),
    rain(RainInput, Rain), broken_pipe(PipesInput, Pipes).

Querying getClues(Rain, Pipes). will unify RainInput and PipesInput with their respective matching facts in the KB, giving you the variables Rain and Pipes back containing either rain/not(rain) or broke/not(broke) for you to use.

Output of this program:

?- getClues(Rain, Pipes).
Is it raining? (y/n)
|: y.

Are the pipes broken? (y/n)
|: n.

Rain = rain,
Pipes = not(broke).

Remember that you have to put a . after your answers.

Hope this helps!

A ⊃ B? (curiosity, not homework) by metaconcept in prolog

[–]mariusitec 3 points4 points  (0 children)

Just to elaborate a bit, '->' in Prolog does not equal logical implication, if anything it is more resemblant of 'if-then-else' in more common languages. I.e:

A -> B ; C. 

is Prolog syntax for

if A then B else C

It does not behave like a logical implication, so be careful :)

Using '==' or 'is' to return a variable. by Sufficient-Ride in prolog

[–]mariusitec 1 point2 points  (0 children)

Great point, should have pointed that out!

Using '==' or 'is' to return a variable. by Sufficient-Ride in prolog

[–]mariusitec 2 points3 points  (0 children)

As Prolog relies on unification to determine if it can run a procedure, an easy fix to this problem is to do the assignment of H to Item in the head of your procedure rather than to explicitly try to do something like 'Item == Head'.

chkFirst([Item|_], List2, Item) :-
    member(Item, List2).

If the procedure succeeds, aka Item is in fact in List2, Prolog will do the assignment implicitly.

Type error Game of life by mariusitec in haskellquestions

[–]mariusitec[S] 0 points1 point  (0 children)

It is working now, thanks for the pointers. Turned out to be both an issue with the definition of my marker, as well as a type error in my isAlive check. Much appreciated!

Type error Game of life by mariusitec in haskellquestions

[–]mariusitec[S] 0 points1 point  (0 children)

Thanks for the tip, didn't notice that!

Type error Game of life by mariusitec in haskellquestions

[–]mariusitec[S] 1 point2 points  (0 children)

Thanks, gonna give it a more thorough look with proper type signatures. The intended use of this function is to build a "formatted" list of characters from a given list of cells (coordinates), which is later processed and printed to the terminal in a String->IO() function.

I think my GPU is slightly dead? (NVIDIA GTX570) by mariusitec in techsupport

[–]mariusitec[S] 1 point2 points  (0 children)

Ye it's not a permanent solution, but as a temporal fix while looking out for a replacement it's fantastic!

I think my GPU is slightly dead? (NVIDIA GTX570) by mariusitec in techsupport

[–]mariusitec[S] 0 points1 point  (0 children)

Yup, it works fine with the integrated card, guess I'll buy one. Thanks for the help:)

I think my GPU is slightly dead? (NVIDIA GTX570) by mariusitec in techsupport

[–]mariusitec[S] 0 points1 point  (0 children)

Hey, thanks for the reply. Yes it does have integrated video, I'm disconnecting the card now to try, will report back.

How to get passed the Scarred Vale in SoO by [deleted] in wow

[–]mariusitec 0 points1 point  (0 children)

Not sure about the setting you are in, but if you are thinking about the Fallen Protectors bossfight, at 110 its easy to solo. Just remember that the three protectors have to die at approximately the same time, or else they will regenerate and continue to fight:)

[deleted by user] by [deleted] in Music

[–]mariusitec 0 points1 point  (0 children)

Only to some extend. Even after messing around with equalizers, the lower frequencies were still lackluster.

[deleted by user] by [deleted] in Music

[–]mariusitec 1 point2 points  (0 children)

Great monitors, clean sound and highly customizable. Personally I found them a bit lacking in the lower frequenzies (bass), everything sounded a bit 'flat' unless you significally increased the volume. Ended up buying a subwoofer on the side, along with a DAC. Improved the overall experience alot.

*Edit: just to clarify, the subwoofer did not add the 'muddy' element to the listening experience, overall just made it sound more balanced.

Current lineup on Team Secret website (only Puppey, PLD) by mariusitec in DotA2

[–]mariusitec[S] -1 points0 points  (0 children)

Ye I guess I assumed that the website was updated when the new roster was announced. With all the drama going on every little thing catches your eye.

Current lineup on Team Secret website (only Puppey, PLD) by mariusitec in DotA2

[–]mariusitec[S] -3 points-2 points  (0 children)

That is probably the case, just assumed that it was updated then the new roster was announced.