Learning Pseudocode: A Crash Course for Beginners

  • Context: Comp Sci 
  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    Beginners Course Crash
Click For Summary

Discussion Overview

The discussion revolves around learning pseudocode, specifically in the context of implementing the minimax algorithm. Participants express their challenges in understanding and applying pseudocode, particularly for those with some programming background but lacking detailed notes or memory of data structures and algorithms (DSA).

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant shares a pseudocode example for the minimax algorithm and expresses a desire to learn how to implement it, noting their limited programming experience and lack of notes on DSA.
  • Another participant references Wikipedia as a reasonable source for understanding pseudocode, mentioning a difference in how player alternation is handled in the provided code versus the Wikipedia example.
  • A subsequent post asks for ideas on how to implement the minimax algorithm, indicating a need for practical guidance.
  • Another participant critiques the provided pseudocode, suggesting it is not true pseudocode and pointing out inconsistencies in the function's argument handling.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the quality of the provided pseudocode, with some expressing confusion and others offering critiques. The discussion remains unresolved regarding the best approach to learning and implementing pseudocode effectively.

Contextual Notes

Participants express uncertainty about the definitions and proper structure of pseudocode, as well as the implementation details of the minimax algorithm. There are unresolved issues regarding the clarity and correctness of the provided pseudocode example.

Who May Find This Useful

Individuals interested in learning pseudocode, particularly those with a basic understanding of programming and data structures, may find this discussion relevant.

shivajikobardan
Messages
637
Reaction score
54
Homework Statement
minimax algorithm artificial intelligence
Relevant Equations
algorithm given below
I found pseudocode for this problem below-:

Code:
def minimax(current node):
    if is_leaf(current_node):
        return static_evaluation(current_node)
    if is_min_node(current_node):
        return min(minimax(children_of(current_node)))
    if is_max_node(current_node):
        return max(minimax(children_of(current_node)))
How do I learn to do it? I have no idea. Learning these stuffs would be immensely useful. I have ok programming experience. Learnt about dsa and stuffs but I don't have any notes from that time and don't remember much stuffs. Know basic python. Know oop but like dsa forgot and don't have the notes...What to do?
 
Physics news on Phys.org
shivajikobardan said:
How do I learn to do it?

The explanation on Wikipedia is reasonable, with similar pseduocode (although that toggles a flag for alternating player whereas the code above has that information in the node).
 
pbuk said:
The explanation on Wikipedia is reasonable, with similar pseduocode (although that toggles a flag for alternating player whereas the code above has that information in the node).
any idea how to implement it?
 
shivajikobardan said:
any idea how to implement it?
Follow the explanation accompanying the code. I suggest you use the Wikipedia page I linked, the code you posted (which appears to be Python not pseudocode) is rubbish: the first line says that the function minimax has a single node as its only argument but on lines 5 and 6 it is called with what must be a list of nodes.
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
6K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 9 ·
Replies
9
Views
11K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K