Example #1
0
        public void codeGenTest_Program_switch_Common_Reversed()
        {
            ASTObject.CGO.DisplayModuloAccess = true;

            BFTestHelper.debugProgram(@"
			program p 
				begin
					OUT '''';
					for (;;) do
						switch RAND[1]
						begin
							case 0:
								OUT ''0 '';
							end
							case 1:
								OUT ''1 '';
							end
							case 2:
								OUT ''2 '';
							end
							case 3:
								OUT ''3 '';
							end
						end
					end

				end
			end
			"            );
        }
Example #2
0
        public void codeGenTest_Program_Modulo_Display_Access()
        {
            ASTObject.CGO.DisplayModuloAccess = true;

            BFTestHelper.debugProgram(@"
			program example : display[64, 16]
				begin
					FOR(;;) DO
						paintR();
					END
				end

				void paintR() 
				var
				 int x;
				 int y;
				begin
					x = ((((((((int)RAND)*2) + ((int)RAND))*2 + ((int)RAND) ) * 2 + ((int)RAND)*2) + ((int)RAND))*2 + ((int)RAND) ) * 2 + ((int)RAND);
					y = ((((((((int)RAND)*2) + ((int)RAND))*2 + ((int)RAND) ) * 2 + ((int)RAND)*2) + ((int)RAND))*2 + ((int)RAND) ) * 2 + ((int)RAND);

					OUT x;
					OUT '','';		
					OUT y;
					OUT ''\r\n'';		

					display[x, y] = '#';

					OUT ''\r\n'';

				end
			end
			"            );
        }