# Questions tagged [cs50ai]

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

22 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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 ...
19 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 ...
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. ...
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 =...
239 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. ...
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 '...
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 ...
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 ...
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(): ...
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:(...
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 ...