# Questions tagged [cs50ai]

The tag has no usage guidance, but it has a tag wiki.

29 questions
Filter by
Sorted by
Tagged with
20 views

### Help checking my implementation of the Minimax Algorithmn for Project 0b in CS50 AI

""" Tic Tac Toe Player """ import math import copy X = "X" O = "O" EMPTY = None util = 0 def initial_state(): """ Returns ...
5 views

### CS50-ai Minimax algorithm is not responsive

I have implemented my minimax() algorithm. My ai is smart enough to find a solution that leads to a victory. However, it completely disregards the optimal move the enemy could do. This way, it is ...
16 views

### What is the meaning of this line of python code?

I am working on the first problem set for CS50. I believe I understand the intent (or specific workings) of every line of code, except this one: path = [(None, source)] + path What does this ...
1k views

### CS50AI Tic tac toe game with minimax algorithm: I keep receive Invalid move

So my code run, but only the first move, after that I keep getting "Invalid move" message (which was declared by myself) in my result function. I'm not sure what's wrong with my result function, or I ...
139 views

### CS50 AI Problem 0B Maximum Recursion Debt in Deepcopy

For CS50 AI Problem 0B, an error occurs when I try to deep copy the board in result(). What can I do? Code: """ Tic Tac Toe Player """ import math import copy X = "X" O = "O" EMPTY = None def ...
127 views

### Struggling with logic on cs50 AI search

I completed CS50 intro to computer science a while back and I am starting the AI course now. I watched the lecture, and I understood how the logic worked for the maze and such, but I'm struggling on ...
63 views

### Lecture question from lecture 1 (cs50AI)

In lecture 1(knowledge), Brian gives an example from Harry Potter and concludes that it did not rain that day. My question is that it's never mentioned in the example that rain causes Harry to not ...
55 views

### Iterative PageRank Questions

I have completed the iterative pagerank in the ai50 course and have a doubt. The example in cs50 for the iterative pagerank is different from mine by about 0.0004. If I have to fix this how do I fix ...
23 views

### Iterative Pagerank Formula

This is the formula cs50 gave us to solve iteratively, And for the second part of the formula we are supposed to repeat until the pagerank doesn't change by more than 0.001. I don't really understand ...
18 views

### Any suggestion for good heuristics for Project 0 - Degrees?

I've completed project 0 - degrees using the general DFS / BFS algorithm. Needless to say it is rather slow. I've been thinking but haven't yet found a good heuristic to speed up the search when ...
27 views

### Minesweeper says it is making a safe move but chooses a mine

Minesweeper says it is making a safe move but chooses a mine. It also makes random moves even though there are safe moves it can make. I don't know why it does that. This is the link to my code below. ...
107 views

### CS50 AI Project 0a CS50 IDE bug

I am a high school student currently enrolled in the CS50 AI online edX course. I downloaded the distribution code for Project 0a, but the CS50 IDE is not able to open the large csv files because it ...
95 views

### TicTacToe task: PyGame display not rendering

For some reason, the PyGame TicTacToe display is not showing. It just hangs at this: This is the runner.py: import pygame import sys import time import tictactoe as ttt pygame.init() size = width, ...
49 views

### i dont know why i got error in the cs50 knight puzzle

from logic import * AKnight = Symbol("A is a Knight") AKnave = Symbol("A is a Knave") BKnight = Symbol("B is a Knight") BKnave = Symbol("B is a Knave") CKnight =...
240 views

### Cs50 ai question

There are other logical connectives that exist, other than the ones discussed in lecture. One of the most common is "Exclusive Or" (represented using the symbol ⊕). The expression A ⊕ B ...
57 views

### CS50ai - Knights: error invalid syntax for part written by CS50ai (that I should not adapt)

I am having some trouble with exercise 'Knights' (week 1 - 2020 CS50ai). https://cs50.harvard.edu/ai/2020/projects/1/knights/ The goal of this exercise is to write a program to solve logic puzzels. ...
460 views

### CS50 AI - Knights - Knowledge 3

having a little trouble with the last part of the knights challenge. When run, it will print nothing for puzzle 3. I have been through the logic countless times now and in my head it seems to work. ...
37 views

### project0 - degrees/ ModuleNotFoundError: No module named 'util'

i'm new in the AI course and i'm trying to solve project 0 (degrees). i still haven't written any code but was trying to run degrees.py and its giving me an error ModuleNotFoundError: No module named '...
1k views

### CS50AI 2020 - Quiz 1 - Entailments

I am not asking for a specific answer, as I assume this would be against the rules of this group, just instructions to the correct approach for the following question: In CS50AI 2020 - Quiz 1, we ...
101 views

### CS50 AI Puzzel.py Knowledge 2

I am struggling to find a solution for it.My logic is that either A could be Knight or Knave and same with B it could be either a Knight or Knave.Hence the first two Ors. Then my logic is that if A is ...
263 views

### Problem with path reversing in CS50 AI -> Degrees

I have a problem in my code that reverses the path my BFS search algorythm takes. The first project in the CS50 Introduction to artificial intelligence is called degrees and finds a path from one ...
151 views

I was trying to add my project submission on github using git. I referred to following website for help https://www.softwarelab.it/2018/10/12/adding-an-existing-project-to-github-using-the-command-...
6 views

### No output when I run the search.py script in Week 6 AI template

I am running the search.py file which is basically searches for a regex and returns all instances. THe following is the code: import csv import itertools import os import re import sys def main(): ...
905 views

### CS50 AI Problem 1A Invalid Syntax

For CS50AI Problem 1 (Knights), I am really confused as to what is producing this error. Code: from logic import * AKnight = Symbol("A is a Knight") AKnave = Symbol("A is a Knave") BKnight = ...
113 views

### cs50ai tic tac toe minimax TypeError: '>' not supported between instances of 'NoneType' and 'float'

I'm working on the tic tac toe problem set. The whole game is working correctly, however I'm having some troubles kicking off the AI. I've been running the game with the computer doing random moves, ...
124 views

### Getting a NameError in the PageRank problem in CS50's Introduction to AI with Python

Here's the implementation code :- https://gist.github.com/ShaunakInamdar/9a914b43bb778aac04e8f254f3e5329f I'm getting an error in line 89 saying "NameError: name 'pageRank' not defined." Somebody ...
143 views

### CS50 AI Exercise 1B Minesweeper pygame error

After implementing all the functions when trying to run runner.py, the game plays fine for a few mins and then hangs while repeatedly printing the following error: ALSA lib pcm.c:8306:(...