Shop OBEX P1 Docs P2 Docs Learn Events
HELP! Simon Says — Parallax Forums

HELP! Simon Says

lynnhhlynnhh Posts: 10
edited 2022-01-23 19:16 in BASIC Stamp

I am trying to make a Simon says game and I have attached my code. I am not getting it the code to do a random sequence of lights, Any help?

Comments

  • ercoerco Posts: 20,256

    Simon is a great coding challenge, looks like a school lab. Your code has several issues, looks like a work in progress. For instance, you are randomizing SEED twice here:

    DO WHILE (IN1=0) AND (IN5=0) AND (IN9=0) AND (IN13=0)
    seed = seed + 1
    LOOP

    FOR k = 0 TO 9
    RANDOM seed
    array (k) = seed //4
    DEBUG ? array
    NEXT

    Please add some comments to your code so we can see what you hope to do.

    For starters, try this mod to get a random number 0-3 based on how long any button is pressed:

    FOR k = 0 TO 9

    DO WHILE (IN1=0) AND (IN5=0) AND (IN9=0) AND (IN13=0)
    seed = seed + 1
    LOOP

    array (k) = seed //4
    DEBUG ? array(k)
    NEXT

Sign In or Register to comment.